| Previous | Next |
| ERROR_IO_PREEMPTED | E_FDPAIRING_NOCONNECTION |
JSCRIPT_E_CANTEXECUTE
Treat JScript function object no longer executable as a contract result, not as justification for resetting unrelated state. The script host retained or invoked a function after the engine had deleted the callable object or garbage collection had made its execution context unavailable. The failure is about object/engine lifetime, not JavaScript syntax.
First returning layer
A parse error happens while compiling script; this code occurs when attempting to execute a callable that no longer has a valid runtime lifetime. Keep JSCRIPT_E_CANTEXECUTE, its numeric value, and the first returning operation together.
Evidence map
| Capture | Diagnostic value |
|---|---|
| Script engine instance, function identity, host callback registration, document/context, and engine state. | Identifies the concrete object and operation associated with JScript function object no longer executable. |
| Event-handler or timer registration that retained the function beyond navigation, teardown, or engine close. | Separates argument or lifecycle state from a lower-layer provider failure. |
| COM reference/lifetime trace for host objects exposed to script. | Creates a stable before-and-after comparison. |
| Minimal reproduction showing the last valid invocation and the teardown event before failure. | Shows whether this condition is the first result or a translated summary. |
Preserve script engine instance, function identity, host callback registration, document/context, and engine state before reinstalling, rebooting, clearing state, or substituting another device or provider.
Change one condition at a time
- Invoke the callback synchronously before engine teardown. Keep unrelated inputs fixed so the changed result remains attributable to the tested variable.
- Remove the timer/event subscription during document unload and compare late calls. Record the first returned status and any state transition observed.
- Keep a deliberate host reference only until IActiveScript reaches the intended state. Treat a changed result as a separate failure rather than automatic resolution.
Repair and regression test
Targeted correction. Unregister callbacks before closing the script engine, avoid retaining function objects across document generations, and serialize teardown with pending host invocations.
Acceptance criterion. No callback runs after engine close, navigation/reload cycles release old function objects, and the current document callbacks remain executable.
Technical references
References for JSCRIPT_E_CANTEXECUTE on the deployed platform version.
- Microsoft Open Specifications: HRESULT values — defines the status namespace used.
- Microsoft: HRESULT facility extraction — documents the API or lifecycle behind this condition.
- Microsoft: Active Script architecture — provides ABI, implementation, or protocol context.
- Microsoft: IActiveScript:Close — supports the portability and verification limits.
Looking for a different code? Search another status or error code.