Meziantou.Framework.JavaScriptEngine namespace

Classes

NameDescription
JsArrayAn Array exotic object (https://tc39.es/ecma262/#sec-array-exotic-objects): length follows the indices.
JsBinaryDataAccess to the bytes of the buffer sources (ArrayBuffer, SharedArrayBuffer, DataView and the typed arrays), without running JavaScript code.
JsCellThe base class of the values that are not numbers nor undefined: objects, strings, symbols, BigInts, null and the booleans.
JsDebuggerReceives the execution events of the scripts of an engine, to build a debugger, a code coverage tool or an execution inspector. Set it in JsEngineOptions.Debugger before the code is compiled.
JsEngineAn ECMAScript agent (https://tc39.es/ecma262/#sec-agents): it owns the realms, the job queue and the execution limits of the scripts it runs. An engine is used by one thread at a time.
JsEngineOptionsThe options of a JsEngine: the limits of the scripts and the host services.
JsExceptionA JavaScript exception: the .NET exception that carries a thrown JavaScript value.
JsExecutionLimitsThe limits of an execution scope (JsEngine.EnterExecutionScope): they apply to all the code that runs in the scope as a whole (the scripts, the calls, the jobs, the parsing of the sources), in addition to the limits of JsEngineOptions. A limit that is exceeded stops the code with a JsTerminationException.
JsExecutionScopeThe scope returned by JsEngine.EnterExecutionScope: the calls made until it is disposed are one entry into JavaScript, bounded by its JsExecutionLimits. Dispose the scopes in the reverse order they were entered, on the thread that entered them.
JsFunctionA JavaScript function: an object with a [[Call]] internal method, and possibly a [[Construct]] internal method.
JsHostThe host-defined operations of the engine (https://tc39.es/ecma262/#sec-host-hooks-summary). The default implementations are the ones of the specification; a host (e.g. a browser) derives from this class to integrate the engine with its event loop, and sets it in JsEngineOptions.Host.
JsHostJobA job that the engine gives to the host to schedule (HostEnqueueGenericJob, HostEnqueueTimeoutJob): the host calls JsHostJob.Run later, on the thread of the engine (e.g. from a task of its event loop).
JsHostObjectAn object implemented by the host (e.g. a platform object of a browser): a derived class can override its internal methods (https://tc39.es/ecma262/#sec-object-internal-methods-and-internal-slots). The default implementations are the ones of an ordinary object, also available with the Ordinary* methods.
JsModuleA Module Record (https://tc39.es/ecma262/#sec-abstract-module-records). A module is loaded (JsModule.LoadRequestedModules), linked (JsModule.Link), then evaluated (JsModule.Evaluate).
JsModuleLoadRequestA request to load a module (the arguments of HostLoadImportedModule).
JsModuleLoaderLoads the modules imported by the scripts and the modules (HostLoadImportedModule, https://tc39.es/ecma262/#sec-HostLoadImportedModule). Set it in JsEngineOptions.ModuleLoader.
JsObjectA JavaScript object. The internal methods (https://tc39.es/ecma262/#sec-object-internal-methods-and-internal-slots) implement the ordinary object behavior; the exotic objects (arrays, proxies, arguments, typed arrays...) override them.
JsPreparedScriptA parsed and compiled script. It is immutable: it can run in several realms and engines, on several threads (e.g. the scripts of a test harness, parsed once for all the pages). The syntax errors of the whole script are reported by JsPreparedScript.Parse, but the body of a nested function is compiled on its first call (once, whichever engine calls it).
JsPromiseRejectionEventArgsThe arguments of JsEngine.UnhandledRejection and JsEngine.RejectionHandled.
JsProxyA Proxy exotic object (https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots): its internal methods call the traps of its handler, and check the invariants of the internal methods against its target.
JsRealmA realm (https://tc39.es/ecma262/#sec-code-realms): a global object, its global environment and the intrinsics.
JsScriptA Script Record (https://tc39.es/ecma262/#sec-script-records).
JsScriptOrModuleA script or a module: the [[ScriptOrModule]] of the running code (https://tc39.es/ecma262/#sec-getactivescriptormodule).
JsSharedDataBlockA Shared Data Block (https://tc39.es/ecma262/#sec-data-blocks): the memory of a SharedArrayBuffer. It can be shared by several engines (agents) running on different threads, e.g. by the structured clone of a SharedArrayBuffer sent to a worker. The memory is a managed array allocated once for the maximum byte length on the pinned object heap: a growable block never moves, its byte length grows atomically. The bytes are 16-byte aligned (the atomic operations of 64-bit values are aligned). The spans, references and memories of the block reference the array, so they keep the memory alive by themselves, even once no SharedArrayBuffer references the block.
JsSourceMapA source map (https://tc39.es/ecma426/, version 3): the positions of the original sources of a generated script, such as a bundle or the output of a compiler. Use it with a JsSourceMapper to show the errors of the script at their original positions.
JsSourceMapperMaps the positions of generated scripts (bundles, the output of a compiler) to their original sources with source maps: the location of a JsException and the stack traces. It does not change the execution of the scripts: the errors and the stack property that the scripts see keep the generated positions.
JsSourceTextModuleA Source Text Module Record (https://tc39.es/ecma262/#sec-source-text-module-records): a module parsed from JavaScript source text.
JsSymbolA JavaScript symbol. Two symbols are the same value only if they are the same instance.
JsSyntaxErrorExceptionThe exception thrown when a source text is not a valid script or module (an early error or a syntax error).
JsSyntheticModuleA Synthetic Module Record (https://tc39.es/ecma262/#sec-synthetic-module-records): a module whose exports are set by the host (e.g. a JSON module).
JsTerminationExceptionThe exception thrown when the engine stops a script: a limit is exceeded or the execution is canceled. The scripts cannot catch it (the catch and finally blocks do not run).

Structs

NameDescription
JsContinuationA handler created by the engine for a promise reaction (e.g. the continuation of an await), which the host calls from JsHost.CallContinuation to restore the state it captured with JsHost.MakeContinuationHostDefined.
JsDebugEventA statement that is about to run, given to the methods of JsDebugger.
JsEngineScopeThe scope returned by JsEngine.Enter: disposing it restores the previous engine of the thread.
JsJobCallbackA JobCallback Record (https://tc39.es/ecma262/#sec-jobcallback-records): a function and the host-defined state captured when it was registered.
JsPropertyDescriptorA property descriptor (https://tc39.es/ecma262/#sec-property-descriptor-specification-type): complete, or partial (the argument of Object.defineProperty).
JsPropertyKeyA property key: a string or a symbol (https://tc39.es/ecma262/#sec-object-type).
JsScriptContextScopeThe scope returned by JsEngine.EnterActiveScriptOrModule: disposing it pops the execution context.
JsSourceLocationA position in the source text of a script or a module: its URL, and the 1-based line and column.
JsValueA JavaScript value: undefined, null, a boolean, a number, a string, a symbol, a BigInt or an object. The default value is undefined. Numbers are not allocated; the other values reference a JsCell.

Enums

NameDescription
JsBufferKindThe kinds of buffer sources: ArrayBuffer, SharedArrayBuffer, DataView and the typed arrays.
JsCompilationTypeThe kind of a compilation of a string by the scripts (HostEnsureCanCompileStrings).
JsErrorTypeThe native error types (https://tc39.es/ecma262/#sec-native-error-types-used-in-this-standard).
JsInternalSlotThe internal slots of the built-in objects (JsObject.HasInternalSlot).
JsModuleStatusThe [[Status]] of a module (https://tc39.es/ecma262/#sec-cyclic-module-records).
JsPromiseRejectionOperationThe operation of HostPromiseRejectionTracker.
JsPromiseStateThe state of a promise ([[PromiseState]]).
JsPropertyDescriptorFlagsThe fields and attributes of a JsPropertyDescriptor.
JsTerminationReasonWhy the engine stopped a script.
JsValueKindThe type of a JavaScript value (https://tc39.es/ecma262/#sec-ecmascript-language-types).

Delegates

NameDescription
JsNativeConstructorThe implementation of a constructor of the host: newTarget is null for [[Call]], and the new.target of [[Construct]] otherwise.
JsNativeFunctionThe implementation of a function of the host: returns the result of a call with thisValue and arguments.