@engine262/engine262 0.0.1-01e9fa95a4e8a1c042efd00492309a2de4998fd0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -0
- package/README.md +149 -0
- package/bin/engine262.js +5 -0
- package/declaration/abstract-ops/all.d.mts +39 -0
- package/declaration/abstract-ops/all.d.mts.map +1 -0
- package/declaration/abstract-ops/arguments-operations.d.mts +14 -0
- package/declaration/abstract-ops/arguments-operations.d.mts.map +1 -0
- package/declaration/abstract-ops/array-objects.d.mts +20 -0
- package/declaration/abstract-ops/array-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/arraybuffer-objects.d.mts +43 -0
- package/declaration/abstract-ops/arraybuffer-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/async-function-operations.d.mts +7 -0
- package/declaration/abstract-ops/async-function-operations.d.mts.map +1 -0
- package/declaration/abstract-ops/async-generator-objects.d.mts +35 -0
- package/declaration/abstract-ops/async-generator-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/data-types-and-values.d.mts +6 -0
- package/declaration/abstract-ops/data-types-and-values.d.mts.map +1 -0
- package/declaration/abstract-ops/dataview-objects.d.mts +20 -0
- package/declaration/abstract-ops/dataview-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/date-objects.d.mts +57 -0
- package/declaration/abstract-ops/date-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/disposable-operations.d.mts +19 -0
- package/declaration/abstract-ops/disposable-operations.d.mts.map +1 -0
- package/declaration/abstract-ops/error-objects.d.mts +8 -0
- package/declaration/abstract-ops/error-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/execution-contexts.d.mts +3 -0
- package/declaration/abstract-ops/execution-contexts.d.mts.map +1 -0
- package/declaration/abstract-ops/function-operations.d.mts +101 -0
- package/declaration/abstract-ops/function-operations.d.mts.map +1 -0
- package/declaration/abstract-ops/generator-operations.d.mts +33 -0
- package/declaration/abstract-ops/generator-operations.d.mts.map +1 -0
- package/declaration/abstract-ops/global-object.d.mts +11 -0
- package/declaration/abstract-ops/global-object.d.mts.map +1 -0
- package/declaration/abstract-ops/immutable-prototype-objects.d.mts +7 -0
- package/declaration/abstract-ops/immutable-prototype-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/import-calls.d.mts +5 -0
- package/declaration/abstract-ops/import-calls.d.mts.map +1 -0
- package/declaration/abstract-ops/iterator-operations.d.mts +53 -0
- package/declaration/abstract-ops/iterator-operations.d.mts.map +1 -0
- package/declaration/abstract-ops/keyed-collections.d.mts +4 -0
- package/declaration/abstract-ops/keyed-collections.d.mts.map +1 -0
- package/declaration/abstract-ops/math.d.mts +23 -0
- package/declaration/abstract-ops/math.d.mts.map +1 -0
- package/declaration/abstract-ops/module-namespace-exotic-objects.d.mts +13 -0
- package/declaration/abstract-ops/module-namespace-exotic-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/module-records.d.mts +64 -0
- package/declaration/abstract-ops/module-records.d.mts.map +1 -0
- package/declaration/abstract-ops/notational-conventions.d.mts +19 -0
- package/declaration/abstract-ops/notational-conventions.d.mts.map +1 -0
- package/declaration/abstract-ops/object-operations.d.mts +79 -0
- package/declaration/abstract-ops/object-operations.d.mts.map +1 -0
- package/declaration/abstract-ops/objects.d.mts +32 -0
- package/declaration/abstract-ops/objects.d.mts.map +1 -0
- package/declaration/abstract-ops/private-names.d.mts +15 -0
- package/declaration/abstract-ops/private-names.d.mts.map +1 -0
- package/declaration/abstract-ops/promise-operations.d.mts +49 -0
- package/declaration/abstract-ops/promise-operations.d.mts.map +1 -0
- package/declaration/abstract-ops/proxy-objects.d.mts +6 -0
- package/declaration/abstract-ops/proxy-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/realms.d.mts +181 -0
- package/declaration/abstract-ops/realms.d.mts.map +1 -0
- package/declaration/abstract-ops/reference-operations.d.mts +28 -0
- package/declaration/abstract-ops/reference-operations.d.mts.map +1 -0
- package/declaration/abstract-ops/regexp-objects.d.mts +28 -0
- package/declaration/abstract-ops/regexp-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/shadow-realm.d.mts +26 -0
- package/declaration/abstract-ops/shadow-realm.d.mts.map +1 -0
- package/declaration/abstract-ops/shared-arraybuffer.d.mts +4 -0
- package/declaration/abstract-ops/shared-arraybuffer.d.mts.map +1 -0
- package/declaration/abstract-ops/spec-types.d.mts +53 -0
- package/declaration/abstract-ops/spec-types.d.mts.map +1 -0
- package/declaration/abstract-ops/string-objects.d.mts +8 -0
- package/declaration/abstract-ops/string-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/symbol-objects.d.mts +11 -0
- package/declaration/abstract-ops/symbol-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/addition.d.mts +62 -0
- package/declaration/abstract-ops/temporal/addition.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/all.d.mts +13 -0
- package/declaration/abstract-ops/temporal/all.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/calendar.d.mts +203 -0
- package/declaration/abstract-ops/temporal/calendar.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/duration.d.mts +126 -0
- package/declaration/abstract-ops/temporal/duration.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/instant.d.mts +25 -0
- package/declaration/abstract-ops/temporal/instant.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/not-implemented.d.mts +5 -0
- package/declaration/abstract-ops/temporal/not-implemented.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/now.d.mts +11 -0
- package/declaration/abstract-ops/temporal/now.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/plain-date-time.d.mts +36 -0
- package/declaration/abstract-ops/temporal/plain-date-time.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/plain-date.d.mts +32 -0
- package/declaration/abstract-ops/temporal/plain-date.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/plain-month-day.d.mts +10 -0
- package/declaration/abstract-ops/temporal/plain-month-day.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/plain-time.d.mts +58 -0
- package/declaration/abstract-ops/temporal/plain-time.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/plain-year-month.d.mts +19 -0
- package/declaration/abstract-ops/temporal/plain-year-month.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/temporal.d.mts +157 -0
- package/declaration/abstract-ops/temporal/temporal.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/time-zone.d.mts +26 -0
- package/declaration/abstract-ops/temporal/time-zone.d.mts.map +1 -0
- package/declaration/abstract-ops/temporal/zoned-datetime.d.mts +28 -0
- package/declaration/abstract-ops/temporal/zoned-datetime.d.mts.map +1 -0
- package/declaration/abstract-ops/testing-comparison.d.mts +35 -0
- package/declaration/abstract-ops/testing-comparison.d.mts.map +1 -0
- package/declaration/abstract-ops/type-conversion.d.mts +62 -0
- package/declaration/abstract-ops/type-conversion.d.mts.map +1 -0
- package/declaration/abstract-ops/typedarray-objects.d.mts +33 -0
- package/declaration/abstract-ops/typedarray-objects.d.mts.map +1 -0
- package/declaration/abstract-ops/weak-operations.d.mts +4 -0
- package/declaration/abstract-ops/weak-operations.d.mts.map +1 -0
- package/declaration/api.d.mts +76 -0
- package/declaration/api.d.mts.map +1 -0
- package/declaration/completion.d.mts +156 -0
- package/declaration/completion.d.mts.map +1 -0
- package/declaration/ecma402/not-implemented.d.mts +3 -0
- package/declaration/ecma402/not-implemented.d.mts.map +1 -0
- package/declaration/evaluator.d.mts +61 -0
- package/declaration/evaluator.d.mts.map +1 -0
- package/declaration/execution-context/Agent.d.mts +75 -0
- package/declaration/execution-context/Agent.d.mts.map +1 -0
- package/declaration/execution-context/Environment.d.mts +175 -0
- package/declaration/execution-context/Environment.d.mts.map +1 -0
- package/declaration/execution-context/ExecutionContext.d.mts +48 -0
- package/declaration/execution-context/ExecutionContext.d.mts.map +1 -0
- package/declaration/execution-context/Job.d.mts +23 -0
- package/declaration/execution-context/Job.d.mts.map +1 -0
- package/declaration/execution-context/PrivateEnvironment.d.mts +12 -0
- package/declaration/execution-context/PrivateEnvironment.d.mts.map +1 -0
- package/declaration/execution-context/Realm.d.mts +24 -0
- package/declaration/execution-context/Realm.d.mts.map +1 -0
- package/declaration/execution-context/WeakReference.d.mts +12 -0
- package/declaration/execution-context/WeakReference.d.mts.map +1 -0
- package/declaration/execution-context/all.d.mts +8 -0
- package/declaration/execution-context/all.d.mts.map +1 -0
- package/declaration/host-defined/base64.d.mts +10 -0
- package/declaration/host-defined/base64.d.mts.map +1 -0
- package/declaration/host-defined/debugger-util.d.mts +2 -0
- package/declaration/host-defined/debugger-util.d.mts.map +1 -0
- package/declaration/host-defined/decimal.d.mts +29 -0
- package/declaration/host-defined/decimal.d.mts.map +1 -0
- package/declaration/host-defined/devtoolsEval.d.mts +3 -0
- package/declaration/host-defined/devtoolsEval.d.mts.map +1 -0
- package/declaration/host-defined/engine.d.mts +133 -0
- package/declaration/host-defined/engine.d.mts.map +1 -0
- package/declaration/host-defined/error-messages.d.mts +45 -0
- package/declaration/host-defined/error-messages.d.mts.map +1 -0
- package/declaration/host-defined/event-loop.d.mts +92 -0
- package/declaration/host-defined/event-loop.d.mts.map +1 -0
- package/declaration/host-defined/ieee754.d.mts +7 -0
- package/declaration/host-defined/ieee754.d.mts.map +1 -0
- package/declaration/host-defined/inspect.d.mts +4 -0
- package/declaration/host-defined/inspect.d.mts.map +1 -0
- package/declaration/host-defined/job-queue.d.mts +42 -0
- package/declaration/host-defined/job-queue.d.mts.map +1 -0
- package/declaration/host-defined/sort.d.mts +14 -0
- package/declaration/host-defined/sort.d.mts.map +1 -0
- package/declaration/host-defined/test262-intrinsics.d.mts +8 -0
- package/declaration/host-defined/test262-intrinsics.d.mts.map +1 -0
- package/declaration/index.d.mts +56 -0
- package/declaration/index.d.mts.map +1 -0
- package/declaration/intrinsics/AbstractModuleSource.d.mts +5 -0
- package/declaration/intrinsics/AbstractModuleSource.d.mts.map +1 -0
- package/declaration/intrinsics/AggregateError.d.mts +3 -0
- package/declaration/intrinsics/AggregateError.d.mts.map +1 -0
- package/declaration/intrinsics/AggregateErrorPrototype.d.mts +3 -0
- package/declaration/intrinsics/AggregateErrorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Array.d.mts +3 -0
- package/declaration/intrinsics/Array.d.mts.map +1 -0
- package/declaration/intrinsics/ArrayBuffer.d.mts +3 -0
- package/declaration/intrinsics/ArrayBuffer.d.mts.map +1 -0
- package/declaration/intrinsics/ArrayBufferPrototype.d.mts +3 -0
- package/declaration/intrinsics/ArrayBufferPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/ArrayIteratorPrototype.d.mts +3 -0
- package/declaration/intrinsics/ArrayIteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/ArrayPrototype.d.mts +3 -0
- package/declaration/intrinsics/ArrayPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/ArrayPrototypeShared.d.mts +8 -0
- package/declaration/intrinsics/ArrayPrototypeShared.d.mts.map +1 -0
- package/declaration/intrinsics/AsyncDisposableStack.d.mts +8 -0
- package/declaration/intrinsics/AsyncDisposableStack.d.mts.map +1 -0
- package/declaration/intrinsics/AsyncDisposableStackPrototype.d.mts +3 -0
- package/declaration/intrinsics/AsyncDisposableStackPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/AsyncFromSyncIteratorPrototype.d.mts +6 -0
- package/declaration/intrinsics/AsyncFromSyncIteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/AsyncFunction.d.mts +3 -0
- package/declaration/intrinsics/AsyncFunction.d.mts.map +1 -0
- package/declaration/intrinsics/AsyncFunctionPrototype.d.mts +3 -0
- package/declaration/intrinsics/AsyncFunctionPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/AsyncGeneratorFunction.d.mts +3 -0
- package/declaration/intrinsics/AsyncGeneratorFunction.d.mts.map +1 -0
- package/declaration/intrinsics/AsyncGeneratorFunctionPrototype.d.mts +3 -0
- package/declaration/intrinsics/AsyncGeneratorFunctionPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/AsyncGeneratorFunctionPrototypePrototype.d.mts +3 -0
- package/declaration/intrinsics/AsyncGeneratorFunctionPrototypePrototype.d.mts.map +1 -0
- package/declaration/intrinsics/AsyncIteratorPrototype.d.mts +3 -0
- package/declaration/intrinsics/AsyncIteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/BigInt.d.mts +8 -0
- package/declaration/intrinsics/BigInt.d.mts.map +1 -0
- package/declaration/intrinsics/BigIntPrototype.d.mts +6 -0
- package/declaration/intrinsics/BigIntPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Boolean.d.mts +8 -0
- package/declaration/intrinsics/Boolean.d.mts.map +1 -0
- package/declaration/intrinsics/BooleanPrototype.d.mts +5 -0
- package/declaration/intrinsics/BooleanPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/DataView.d.mts +12 -0
- package/declaration/intrinsics/DataView.d.mts.map +1 -0
- package/declaration/intrinsics/DataViewPrototype.d.mts +3 -0
- package/declaration/intrinsics/DataViewPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Date.d.mts +8 -0
- package/declaration/intrinsics/Date.d.mts.map +1 -0
- package/declaration/intrinsics/DatePrototype.d.mts +12 -0
- package/declaration/intrinsics/DatePrototype.d.mts.map +1 -0
- package/declaration/intrinsics/DisposableStack.d.mts +8 -0
- package/declaration/intrinsics/DisposableStack.d.mts.map +1 -0
- package/declaration/intrinsics/DisposableStackPrototype.d.mts +3 -0
- package/declaration/intrinsics/DisposableStackPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Error.d.mts +18 -0
- package/declaration/intrinsics/Error.d.mts.map +1 -0
- package/declaration/intrinsics/ErrorPrototype.d.mts +3 -0
- package/declaration/intrinsics/ErrorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/FinalizationRegistry.d.mts +16 -0
- package/declaration/intrinsics/FinalizationRegistry.d.mts.map +1 -0
- package/declaration/intrinsics/FinalizationRegistryPrototype.d.mts +3 -0
- package/declaration/intrinsics/FinalizationRegistryPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/ForInIteratorPrototype.d.mts +13 -0
- package/declaration/intrinsics/ForInIteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Function.d.mts +3 -0
- package/declaration/intrinsics/Function.d.mts.map +1 -0
- package/declaration/intrinsics/FunctionPrototype.d.mts +13 -0
- package/declaration/intrinsics/FunctionPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/GeneratorFunction.d.mts +3 -0
- package/declaration/intrinsics/GeneratorFunction.d.mts.map +1 -0
- package/declaration/intrinsics/GeneratorFunctionPrototype.d.mts +3 -0
- package/declaration/intrinsics/GeneratorFunctionPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/GeneratorFunctionPrototypePrototype.d.mts +3 -0
- package/declaration/intrinsics/GeneratorFunctionPrototypePrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Iterator.d.mts +3 -0
- package/declaration/intrinsics/Iterator.d.mts.map +1 -0
- package/declaration/intrinsics/IteratorHelperPrototype.d.mts +3 -0
- package/declaration/intrinsics/IteratorHelperPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/IteratorPrototype.d.mts +3 -0
- package/declaration/intrinsics/IteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/JSON.d.mts +9 -0
- package/declaration/intrinsics/JSON.d.mts.map +1 -0
- package/declaration/intrinsics/Map.d.mts +13 -0
- package/declaration/intrinsics/Map.d.mts.map +1 -0
- package/declaration/intrinsics/MapIteratorPrototype.d.mts +7 -0
- package/declaration/intrinsics/MapIteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/MapPrototype.d.mts +3 -0
- package/declaration/intrinsics/MapPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Math.d.mts +4 -0
- package/declaration/intrinsics/Math.d.mts.map +1 -0
- package/declaration/intrinsics/NativeError.d.mts +6 -0
- package/declaration/intrinsics/NativeError.d.mts.map +1 -0
- package/declaration/intrinsics/Number.d.mts +8 -0
- package/declaration/intrinsics/Number.d.mts.map +1 -0
- package/declaration/intrinsics/NumberPrototype.d.mts +5 -0
- package/declaration/intrinsics/NumberPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Object.d.mts +3 -0
- package/declaration/intrinsics/Object.d.mts.map +1 -0
- package/declaration/intrinsics/ObjectPrototype.d.mts +5 -0
- package/declaration/intrinsics/ObjectPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Promise.d.mts +18 -0
- package/declaration/intrinsics/Promise.d.mts.map +1 -0
- package/declaration/intrinsics/PromisePrototype.d.mts +3 -0
- package/declaration/intrinsics/PromisePrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Proxy.d.mts +12 -0
- package/declaration/intrinsics/Proxy.d.mts.map +1 -0
- package/declaration/intrinsics/Reflect.d.mts +3 -0
- package/declaration/intrinsics/Reflect.d.mts.map +1 -0
- package/declaration/intrinsics/RegExp.d.mts +13 -0
- package/declaration/intrinsics/RegExp.d.mts.map +1 -0
- package/declaration/intrinsics/RegExpPrototype.d.mts +12 -0
- package/declaration/intrinsics/RegExpPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/RegExpStringIteratorPrototype.d.mts +7 -0
- package/declaration/intrinsics/RegExpStringIteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Set.d.mts +8 -0
- package/declaration/intrinsics/Set.d.mts.map +1 -0
- package/declaration/intrinsics/SetIteratorPrototype.d.mts +7 -0
- package/declaration/intrinsics/SetIteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/SetPrototype.d.mts +3 -0
- package/declaration/intrinsics/SetPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/ShadowRealm.d.mts +8 -0
- package/declaration/intrinsics/ShadowRealm.d.mts.map +1 -0
- package/declaration/intrinsics/ShadowRealmPrototype.d.mts +3 -0
- package/declaration/intrinsics/ShadowRealmPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/String.d.mts +10 -0
- package/declaration/intrinsics/String.d.mts.map +1 -0
- package/declaration/intrinsics/StringIteratorPrototype.d.mts +3 -0
- package/declaration/intrinsics/StringIteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/StringPrototype.d.mts +6 -0
- package/declaration/intrinsics/StringPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/SuppressedError.d.mts +3 -0
- package/declaration/intrinsics/SuppressedError.d.mts.map +1 -0
- package/declaration/intrinsics/SuppressedErrorPrototype.d.mts +3 -0
- package/declaration/intrinsics/SuppressedErrorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Symbol.d.mts +8 -0
- package/declaration/intrinsics/Symbol.d.mts.map +1 -0
- package/declaration/intrinsics/SymbolPrototype.d.mts +6 -0
- package/declaration/intrinsics/SymbolPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/Duration.d.mts +18 -0
- package/declaration/intrinsics/Temporal/Duration.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/DurationPrototype.d.mts +3 -0
- package/declaration/intrinsics/Temporal/DurationPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/Instant.d.mts +9 -0
- package/declaration/intrinsics/Temporal/Instant.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/InstantPrototype.d.mts +3 -0
- package/declaration/intrinsics/Temporal/InstantPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/Now.d.mts +3 -0
- package/declaration/intrinsics/Temporal/Now.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainDate.d.mts +16 -0
- package/declaration/intrinsics/Temporal/PlainDate.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainDatePrototype.d.mts +3 -0
- package/declaration/intrinsics/Temporal/PlainDatePrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainDateTime.d.mts +17 -0
- package/declaration/intrinsics/Temporal/PlainDateTime.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainDateTimePrototype.d.mts +3 -0
- package/declaration/intrinsics/Temporal/PlainDateTimePrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainMonthDay.d.mts +12 -0
- package/declaration/intrinsics/Temporal/PlainMonthDay.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainMonthDayPrototype.d.mts +3 -0
- package/declaration/intrinsics/Temporal/PlainMonthDayPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainTime.d.mts +9 -0
- package/declaration/intrinsics/Temporal/PlainTime.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainTimePrototype.d.mts +3 -0
- package/declaration/intrinsics/Temporal/PlainTimePrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainYearMonth.d.mts +17 -0
- package/declaration/intrinsics/Temporal/PlainYearMonth.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/PlainYearMonthPrototype.d.mts +3 -0
- package/declaration/intrinsics/Temporal/PlainYearMonthPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/Temporal.d.mts +3 -0
- package/declaration/intrinsics/Temporal/Temporal.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/ZonedDateTime.d.mts +13 -0
- package/declaration/intrinsics/Temporal/ZonedDateTime.d.mts.map +1 -0
- package/declaration/intrinsics/Temporal/ZonedDateTimePrototype.d.mts +3 -0
- package/declaration/intrinsics/Temporal/ZonedDateTimePrototype.d.mts.map +1 -0
- package/declaration/intrinsics/ThrowTypeError.d.mts +3 -0
- package/declaration/intrinsics/ThrowTypeError.d.mts.map +1 -0
- package/declaration/intrinsics/TypedArray.d.mts +196 -0
- package/declaration/intrinsics/TypedArray.d.mts.map +1 -0
- package/declaration/intrinsics/TypedArrayConstructors.d.mts +3 -0
- package/declaration/intrinsics/TypedArrayConstructors.d.mts.map +1 -0
- package/declaration/intrinsics/TypedArrayPrototype.d.mts +3 -0
- package/declaration/intrinsics/TypedArrayPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/TypedArrayPrototypes.d.mts +4 -0
- package/declaration/intrinsics/TypedArrayPrototypes.d.mts.map +1 -0
- package/declaration/intrinsics/TypedArray_Uint8Array.d.mts +3 -0
- package/declaration/intrinsics/TypedArray_Uint8Array.d.mts.map +1 -0
- package/declaration/intrinsics/URIHandling.d.mts +3 -0
- package/declaration/intrinsics/URIHandling.d.mts.map +1 -0
- package/declaration/intrinsics/WeakMap.d.mts +11 -0
- package/declaration/intrinsics/WeakMap.d.mts.map +1 -0
- package/declaration/intrinsics/WeakMapPrototype.d.mts +3 -0
- package/declaration/intrinsics/WeakMapPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/WeakRef.d.mts +8 -0
- package/declaration/intrinsics/WeakRef.d.mts.map +1 -0
- package/declaration/intrinsics/WeakRefPrototype.d.mts +3 -0
- package/declaration/intrinsics/WeakRefPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/WeakSet.d.mts +8 -0
- package/declaration/intrinsics/WeakSet.d.mts.map +1 -0
- package/declaration/intrinsics/WeakSetPrototype.d.mts +3 -0
- package/declaration/intrinsics/WeakSetPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/WrapForValidIteratorPrototype.d.mts +3 -0
- package/declaration/intrinsics/WrapForValidIteratorPrototype.d.mts.map +1 -0
- package/declaration/intrinsics/bootstrap.d.mts +19 -0
- package/declaration/intrinsics/bootstrap.d.mts.map +1 -0
- package/declaration/intrinsics/eval.d.mts +3 -0
- package/declaration/intrinsics/eval.d.mts.map +1 -0
- package/declaration/intrinsics/isFinite.d.mts +3 -0
- package/declaration/intrinsics/isFinite.d.mts.map +1 -0
- package/declaration/intrinsics/isNaN.d.mts +3 -0
- package/declaration/intrinsics/isNaN.d.mts.map +1 -0
- package/declaration/intrinsics/parseFloat.d.mts +3 -0
- package/declaration/intrinsics/parseFloat.d.mts.map +1 -0
- package/declaration/intrinsics/parseInt.d.mts +3 -0
- package/declaration/intrinsics/parseInt.d.mts.map +1 -0
- package/declaration/modules.d.mts +126 -0
- package/declaration/modules.d.mts.map +1 -0
- package/declaration/parse.d.mts +35 -0
- package/declaration/parse.d.mts.map +1 -0
- package/declaration/parser/BaseParser.d.mts +24 -0
- package/declaration/parser/BaseParser.d.mts.map +1 -0
- package/declaration/parser/ExpressionParser.d.mts +70 -0
- package/declaration/parser/ExpressionParser.d.mts.map +1 -0
- package/declaration/parser/FunctionParser.d.mts +43 -0
- package/declaration/parser/FunctionParser.d.mts.map +1 -0
- package/declaration/parser/IdentifierParser.d.mts +12 -0
- package/declaration/parser/IdentifierParser.d.mts.map +1 -0
- package/declaration/parser/LanguageParser.d.mts +10 -0
- package/declaration/parser/LanguageParser.d.mts.map +1 -0
- package/declaration/parser/Lexer.d.mts +76 -0
- package/declaration/parser/Lexer.d.mts.map +1 -0
- package/declaration/parser/ModuleParser.d.mts +19 -0
- package/declaration/parser/ModuleParser.d.mts.map +1 -0
- package/declaration/parser/ParseNode.d.mts +1323 -0
- package/declaration/parser/ParseNode.d.mts.map +1 -0
- package/declaration/parser/Parser.d.mts +30 -0
- package/declaration/parser/Parser.d.mts.map +1 -0
- package/declaration/parser/RegExpParser.d.mts +67 -0
- package/declaration/parser/RegExpParser.d.mts.map +1 -0
- package/declaration/parser/Scope.d.mts +114 -0
- package/declaration/parser/Scope.d.mts.map +1 -0
- package/declaration/parser/StatementParser.d.mts +56 -0
- package/declaration/parser/StatementParser.d.mts.map +1 -0
- package/declaration/parser/TemporalParser.d.mts +211 -0
- package/declaration/parser/TemporalParser.d.mts.map +1 -0
- package/declaration/parser/tokens.d.mts +31 -0
- package/declaration/parser/tokens.d.mts.map +1 -0
- package/declaration/parser/utils.d.mts +10 -0
- package/declaration/parser/utils.d.mts.map +1 -0
- package/declaration/runtime-semantics/AdditiveExpression.d.mts +3 -0
- package/declaration/runtime-semantics/AdditiveExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/ApplyStringOrNumericBinaryOperator.d.mts +5 -0
- package/declaration/runtime-semantics/ApplyStringOrNumericBinaryOperator.d.mts.map +1 -0
- package/declaration/runtime-semantics/ArgumentListEvaluation.d.mts +5 -0
- package/declaration/runtime-semantics/ArgumentListEvaluation.d.mts.map +1 -0
- package/declaration/runtime-semantics/ArrayLiteral.d.mts +5 -0
- package/declaration/runtime-semantics/ArrayLiteral.d.mts.map +1 -0
- package/declaration/runtime-semantics/ArrowFunction.d.mts +4 -0
- package/declaration/runtime-semantics/ArrowFunction.d.mts.map +1 -0
- package/declaration/runtime-semantics/AssignmentExpression.d.mts +8 -0
- package/declaration/runtime-semantics/AssignmentExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/AsyncArrowFunction.d.mts +4 -0
- package/declaration/runtime-semantics/AsyncArrowFunction.d.mts.map +1 -0
- package/declaration/runtime-semantics/AsyncFunctionExpression.d.mts +4 -0
- package/declaration/runtime-semantics/AsyncFunctionExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/AsyncGeneratorExpression.d.mts +4 -0
- package/declaration/runtime-semantics/AsyncGeneratorExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/AwaitExpression.d.mts +5 -0
- package/declaration/runtime-semantics/AwaitExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/BindingInitialization.d.mts +8 -0
- package/declaration/runtime-semantics/BindingInitialization.d.mts.map +1 -0
- package/declaration/runtime-semantics/BitwiseOperators.d.mts +5 -0
- package/declaration/runtime-semantics/BitwiseOperators.d.mts.map +1 -0
- package/declaration/runtime-semantics/Block.d.mts +8 -0
- package/declaration/runtime-semantics/Block.d.mts.map +1 -0
- package/declaration/runtime-semantics/BreakStatement.d.mts +4 -0
- package/declaration/runtime-semantics/BreakStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/BreakableStatement.d.mts +4 -0
- package/declaration/runtime-semantics/BreakableStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/CallExpression.d.mts +5 -0
- package/declaration/runtime-semantics/CallExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/ClassDeclaration.d.mts +8 -0
- package/declaration/runtime-semantics/ClassDeclaration.d.mts.map +1 -0
- package/declaration/runtime-semantics/ClassDefinitionEvaluation.d.mts +88 -0
- package/declaration/runtime-semantics/ClassDefinitionEvaluation.d.mts.map +1 -0
- package/declaration/runtime-semantics/ClassExpression.d.mts +5 -0
- package/declaration/runtime-semantics/ClassExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/ClassFieldDefinitionEvaluation.d.mts +21 -0
- package/declaration/runtime-semantics/ClassFieldDefinitionEvaluation.d.mts.map +1 -0
- package/declaration/runtime-semantics/ClassStaticBlockDefinitionEvaluation.d.mts +13 -0
- package/declaration/runtime-semantics/ClassStaticBlockDefinitionEvaluation.d.mts.map +1 -0
- package/declaration/runtime-semantics/CoalesceExpression.d.mts +5 -0
- package/declaration/runtime-semantics/CoalesceExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/CommaOperator.d.mts +5 -0
- package/declaration/runtime-semantics/CommaOperator.d.mts.map +1 -0
- package/declaration/runtime-semantics/ConditionalExpression.d.mts +5 -0
- package/declaration/runtime-semantics/ConditionalExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/ContinueStatement.d.mts +4 -0
- package/declaration/runtime-semantics/ContinueStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/CreateDynamicFunction.d.mts +4 -0
- package/declaration/runtime-semantics/CreateDynamicFunction.d.mts.map +1 -0
- package/declaration/runtime-semantics/DebuggerStatement.d.mts +5 -0
- package/declaration/runtime-semantics/DebuggerStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/DefineMethod.d.mts +10 -0
- package/declaration/runtime-semantics/DefineMethod.d.mts.map +1 -0
- package/declaration/runtime-semantics/DestructuringAssignmentEvaluation.d.mts +5 -0
- package/declaration/runtime-semantics/DestructuringAssignmentEvaluation.d.mts.map +1 -0
- package/declaration/runtime-semantics/EmptyStatement.d.mts +5 -0
- package/declaration/runtime-semantics/EmptyStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/EqualityExpression.d.mts +6 -0
- package/declaration/runtime-semantics/EqualityExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/EvaluateBody.d.mts +37 -0
- package/declaration/runtime-semantics/EvaluateBody.d.mts.map +1 -0
- package/declaration/runtime-semantics/EvaluateCall.d.mts +5 -0
- package/declaration/runtime-semantics/EvaluateCall.d.mts.map +1 -0
- package/declaration/runtime-semantics/EvaluatePropertyAccess.d.mts +9 -0
- package/declaration/runtime-semantics/EvaluatePropertyAccess.d.mts.map +1 -0
- package/declaration/runtime-semantics/EvaluateStringOrNumericBinaryExpression.d.mts +6 -0
- package/declaration/runtime-semantics/EvaluateStringOrNumericBinaryExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/ExponentiationExpression.d.mts +5 -0
- package/declaration/runtime-semantics/ExponentiationExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/ExportDeclaration.d.mts +11 -0
- package/declaration/runtime-semantics/ExportDeclaration.d.mts.map +1 -0
- package/declaration/runtime-semantics/ExpressionStatement.d.mts +5 -0
- package/declaration/runtime-semantics/ExpressionStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/ForDeclarationBindingInitialization.d.mts +7 -0
- package/declaration/runtime-semantics/ForDeclarationBindingInitialization.d.mts.map +1 -0
- package/declaration/runtime-semantics/FunctionDeclaration.d.mts +5 -0
- package/declaration/runtime-semantics/FunctionDeclaration.d.mts.map +1 -0
- package/declaration/runtime-semantics/FunctionDeclarationInstantiation.d.mts +6 -0
- package/declaration/runtime-semantics/FunctionDeclarationInstantiation.d.mts.map +1 -0
- package/declaration/runtime-semantics/FunctionExpression.d.mts +4 -0
- package/declaration/runtime-semantics/FunctionExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/FunctionStatementList.d.mts +5 -0
- package/declaration/runtime-semantics/FunctionStatementList.d.mts.map +1 -0
- package/declaration/runtime-semantics/GeneratorExpression.d.mts +4 -0
- package/declaration/runtime-semantics/GeneratorExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/GetSubstitution.d.mts +5 -0
- package/declaration/runtime-semantics/GetSubstitution.d.mts.map +1 -0
- package/declaration/runtime-semantics/GlobalDeclarationInstantiation.d.mts +5 -0
- package/declaration/runtime-semantics/GlobalDeclarationInstantiation.d.mts.map +1 -0
- package/declaration/runtime-semantics/HoistableDeclaration.d.mts +5 -0
- package/declaration/runtime-semantics/HoistableDeclaration.d.mts.map +1 -0
- package/declaration/runtime-semantics/IdentifierReference.d.mts +6 -0
- package/declaration/runtime-semantics/IdentifierReference.d.mts.map +1 -0
- package/declaration/runtime-semantics/IfStatement.d.mts +11 -0
- package/declaration/runtime-semantics/IfStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/ImportCall.d.mts +6 -0
- package/declaration/runtime-semantics/ImportCall.d.mts.map +1 -0
- package/declaration/runtime-semantics/ImportDeclaration.d.mts +5 -0
- package/declaration/runtime-semantics/ImportDeclaration.d.mts.map +1 -0
- package/declaration/runtime-semantics/ImportMeta.d.mts +5 -0
- package/declaration/runtime-semantics/ImportMeta.d.mts.map +1 -0
- package/declaration/runtime-semantics/InstantiateArrowFunctionExpression.d.mts +5 -0
- package/declaration/runtime-semantics/InstantiateArrowFunctionExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/InstantiateAsyncArrowFunctionExpression.d.mts +5 -0
- package/declaration/runtime-semantics/InstantiateAsyncArrowFunctionExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/InstantiateAsyncFunctionExpression.d.mts +5 -0
- package/declaration/runtime-semantics/InstantiateAsyncFunctionExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/InstantiateAsyncGeneratorFunctionExpression.d.mts +5 -0
- package/declaration/runtime-semantics/InstantiateAsyncGeneratorFunctionExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/InstantiateFunctionObject.d.mts +12 -0
- package/declaration/runtime-semantics/InstantiateFunctionObject.d.mts.map +1 -0
- package/declaration/runtime-semantics/InstantiateGeneratorFunctionExpression.d.mts +5 -0
- package/declaration/runtime-semantics/InstantiateGeneratorFunctionExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/InstantiateOrdinaryFunctionExpression.d.mts +5 -0
- package/declaration/runtime-semantics/InstantiateOrdinaryFunctionExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/IteratorBindingInitialization.d.mts +7 -0
- package/declaration/runtime-semantics/IteratorBindingInitialization.d.mts.map +1 -0
- package/declaration/runtime-semantics/KeyedBindingInitialization.d.mts +6 -0
- package/declaration/runtime-semantics/KeyedBindingInitialization.d.mts.map +1 -0
- package/declaration/runtime-semantics/LabelledEvaluation.d.mts +7 -0
- package/declaration/runtime-semantics/LabelledEvaluation.d.mts.map +1 -0
- package/declaration/runtime-semantics/LabelledStatement.d.mts +4 -0
- package/declaration/runtime-semantics/LabelledStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/LexicalDeclaration.d.mts +14 -0
- package/declaration/runtime-semantics/LexicalDeclaration.d.mts.map +1 -0
- package/declaration/runtime-semantics/Literal.d.mts +6 -0
- package/declaration/runtime-semantics/Literal.d.mts.map +1 -0
- package/declaration/runtime-semantics/LogicalANDExpression.d.mts +5 -0
- package/declaration/runtime-semantics/LogicalANDExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/LogicalORExpression.d.mts +5 -0
- package/declaration/runtime-semantics/LogicalORExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/MV.d.mts +3 -0
- package/declaration/runtime-semantics/MV.d.mts.map +1 -0
- package/declaration/runtime-semantics/MemberExpression.d.mts +5 -0
- package/declaration/runtime-semantics/MemberExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/MethodDefinitionEvaluation.d.mts +28 -0
- package/declaration/runtime-semantics/MethodDefinitionEvaluation.d.mts.map +1 -0
- package/declaration/runtime-semantics/Module.d.mts +11 -0
- package/declaration/runtime-semantics/Module.d.mts.map +1 -0
- package/declaration/runtime-semantics/ModuleBody.d.mts +4 -0
- package/declaration/runtime-semantics/ModuleBody.d.mts.map +1 -0
- package/declaration/runtime-semantics/MultiplicativeExpression.d.mts +5 -0
- package/declaration/runtime-semantics/MultiplicativeExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/NamedEvaluation.d.mts +4 -0
- package/declaration/runtime-semantics/NamedEvaluation.d.mts.map +1 -0
- package/declaration/runtime-semantics/NewExpression.d.mts +5 -0
- package/declaration/runtime-semantics/NewExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/NewTarget.d.mts +3 -0
- package/declaration/runtime-semantics/NewTarget.d.mts.map +1 -0
- package/declaration/runtime-semantics/NumberToBigInt.d.mts +4 -0
- package/declaration/runtime-semantics/NumberToBigInt.d.mts.map +1 -0
- package/declaration/runtime-semantics/ObjectLiteral.d.mts +5 -0
- package/declaration/runtime-semantics/ObjectLiteral.d.mts.map +1 -0
- package/declaration/runtime-semantics/OptionalExpression.d.mts +5 -0
- package/declaration/runtime-semantics/OptionalExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/ParenthesizedExpression.d.mts +4 -0
- package/declaration/runtime-semantics/ParenthesizedExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/PropertyBindingInitialization.d.mts +6 -0
- package/declaration/runtime-semantics/PropertyBindingInitialization.d.mts.map +1 -0
- package/declaration/runtime-semantics/PropertyDefinitionEvaluation.d.mts +6 -0
- package/declaration/runtime-semantics/PropertyDefinitionEvaluation.d.mts.map +1 -0
- package/declaration/runtime-semantics/PropertyName.d.mts +5 -0
- package/declaration/runtime-semantics/PropertyName.d.mts.map +1 -0
- package/declaration/runtime-semantics/RegExp.d.mts +36 -0
- package/declaration/runtime-semantics/RegExp.d.mts.map +1 -0
- package/declaration/runtime-semantics/RegularExpressionLiteral.d.mts +4 -0
- package/declaration/runtime-semantics/RegularExpressionLiteral.d.mts.map +1 -0
- package/declaration/runtime-semantics/RelationalExpression.d.mts +8 -0
- package/declaration/runtime-semantics/RelationalExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/RestBindingInitialization.d.mts +5 -0
- package/declaration/runtime-semantics/RestBindingInitialization.d.mts.map +1 -0
- package/declaration/runtime-semantics/ReturnStatement.d.mts +6 -0
- package/declaration/runtime-semantics/ReturnStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/Script.d.mts +5 -0
- package/declaration/runtime-semantics/Script.d.mts.map +1 -0
- package/declaration/runtime-semantics/ScriptBody.d.mts +3 -0
- package/declaration/runtime-semantics/ScriptBody.d.mts.map +1 -0
- package/declaration/runtime-semantics/ShiftExpression.d.mts +7 -0
- package/declaration/runtime-semantics/ShiftExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/StatementList.d.mts +5 -0
- package/declaration/runtime-semantics/StatementList.d.mts.map +1 -0
- package/declaration/runtime-semantics/StringIndexOf.d.mts +3 -0
- package/declaration/runtime-semantics/StringIndexOf.d.mts.map +1 -0
- package/declaration/runtime-semantics/StringPad.d.mts +5 -0
- package/declaration/runtime-semantics/StringPad.d.mts.map +1 -0
- package/declaration/runtime-semantics/SuperCall.d.mts +5 -0
- package/declaration/runtime-semantics/SuperCall.d.mts.map +1 -0
- package/declaration/runtime-semantics/SuperProperty.d.mts +5 -0
- package/declaration/runtime-semantics/SuperProperty.d.mts.map +1 -0
- package/declaration/runtime-semantics/SwitchStatement.d.mts +9 -0
- package/declaration/runtime-semantics/SwitchStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/TaggedTemplateExpression.d.mts +5 -0
- package/declaration/runtime-semantics/TaggedTemplateExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/TemplateLiteral.d.mts +5 -0
- package/declaration/runtime-semantics/TemplateLiteral.d.mts.map +1 -0
- package/declaration/runtime-semantics/This.d.mts +5 -0
- package/declaration/runtime-semantics/This.d.mts.map +1 -0
- package/declaration/runtime-semantics/ThrowStatement.d.mts +5 -0
- package/declaration/runtime-semantics/ThrowStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/TrimString.d.mts +5 -0
- package/declaration/runtime-semantics/TrimString.d.mts.map +1 -0
- package/declaration/runtime-semantics/TryStatement.d.mts +10 -0
- package/declaration/runtime-semantics/TryStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/UnaryExpression.d.mts +4 -0
- package/declaration/runtime-semantics/UnaryExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/Unicode.d.mts +166 -0
- package/declaration/runtime-semantics/Unicode.d.mts.map +1 -0
- package/declaration/runtime-semantics/UpdateExpression.d.mts +4 -0
- package/declaration/runtime-semantics/UpdateExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/VariableStatement.d.mts +7 -0
- package/declaration/runtime-semantics/VariableStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/WithStatement.d.mts +10 -0
- package/declaration/runtime-semantics/WithStatement.d.mts.map +1 -0
- package/declaration/runtime-semantics/YieldExpression.d.mts +5 -0
- package/declaration/runtime-semantics/YieldExpression.d.mts.map +1 -0
- package/declaration/runtime-semantics/all.d.mts +110 -0
- package/declaration/runtime-semantics/all.d.mts.map +1 -0
- package/declaration/static-semantics/BodyText.d.mts +4 -0
- package/declaration/static-semantics/BodyText.d.mts.map +1 -0
- package/declaration/static-semantics/BoundNames.d.mts +4 -0
- package/declaration/static-semantics/BoundNames.d.mts.map +1 -0
- package/declaration/static-semantics/CharacterValue.d.mts +6 -0
- package/declaration/static-semantics/CharacterValue.d.mts.map +1 -0
- package/declaration/static-semantics/CodePointAt.d.mts +8 -0
- package/declaration/static-semantics/CodePointAt.d.mts.map +1 -0
- package/declaration/static-semantics/CodePointsToString.d.mts +3 -0
- package/declaration/static-semantics/CodePointsToString.d.mts.map +1 -0
- package/declaration/static-semantics/ConstructorMethod.d.mts +4 -0
- package/declaration/static-semantics/ConstructorMethod.d.mts.map +1 -0
- package/declaration/static-semantics/ContainsArguments.d.mts +4 -0
- package/declaration/static-semantics/ContainsArguments.d.mts.map +1 -0
- package/declaration/static-semantics/ContainsExpression.d.mts +3 -0
- package/declaration/static-semantics/ContainsExpression.d.mts.map +1 -0
- package/declaration/static-semantics/ContainsUsing.d.mts +4 -0
- package/declaration/static-semantics/ContainsUsing.d.mts.map +1 -0
- package/declaration/static-semantics/DeclarationPart.d.mts +3 -0
- package/declaration/static-semantics/DeclarationPart.d.mts.map +1 -0
- package/declaration/static-semantics/ExpectedArgumentCount.d.mts +3 -0
- package/declaration/static-semantics/ExpectedArgumentCount.d.mts.map +1 -0
- package/declaration/static-semantics/ExportEntries.d.mts +14 -0
- package/declaration/static-semantics/ExportEntries.d.mts.map +1 -0
- package/declaration/static-semantics/ExportEntriesForModule.d.mts +5 -0
- package/declaration/static-semantics/ExportEntriesForModule.d.mts.map +1 -0
- package/declaration/static-semantics/FlagText.d.mts +4 -0
- package/declaration/static-semantics/FlagText.d.mts.map +1 -0
- package/declaration/static-semantics/HasInitializer.d.mts +5 -0
- package/declaration/static-semantics/HasInitializer.d.mts.map +1 -0
- package/declaration/static-semantics/HasName.d.mts +3 -0
- package/declaration/static-semantics/HasName.d.mts.map +1 -0
- package/declaration/static-semantics/ImportEntries.d.mts +11 -0
- package/declaration/static-semantics/ImportEntries.d.mts.map +1 -0
- package/declaration/static-semantics/ImportEntriesForModule.d.mts +4 -0
- package/declaration/static-semantics/ImportEntriesForModule.d.mts.map +1 -0
- package/declaration/static-semantics/ImportedLocalNames.d.mts +4 -0
- package/declaration/static-semantics/ImportedLocalNames.d.mts.map +1 -0
- package/declaration/static-semantics/IsAnonymousFunctionDefinition.d.mts +4 -0
- package/declaration/static-semantics/IsAnonymousFunctionDefinition.d.mts.map +1 -0
- package/declaration/static-semantics/IsAwaitUsingDeclaration.d.mts +3 -0
- package/declaration/static-semantics/IsAwaitUsingDeclaration.d.mts.map +1 -0
- package/declaration/static-semantics/IsComputedPropertyKey.d.mts +3 -0
- package/declaration/static-semantics/IsComputedPropertyKey.d.mts.map +1 -0
- package/declaration/static-semantics/IsConstantDeclaration.d.mts +3 -0
- package/declaration/static-semantics/IsConstantDeclaration.d.mts.map +1 -0
- package/declaration/static-semantics/IsDestructuring.d.mts +4 -0
- package/declaration/static-semantics/IsDestructuring.d.mts.map +1 -0
- package/declaration/static-semantics/IsFunctionDefinition.d.mts +6 -0
- package/declaration/static-semantics/IsFunctionDefinition.d.mts.map +1 -0
- package/declaration/static-semantics/IsIdentifierRef.d.mts +3 -0
- package/declaration/static-semantics/IsIdentifierRef.d.mts.map +1 -0
- package/declaration/static-semantics/IsInTailPosition.d.mts +3 -0
- package/declaration/static-semantics/IsInTailPosition.d.mts.map +1 -0
- package/declaration/static-semantics/IsSimpleParameterList.d.mts +3 -0
- package/declaration/static-semantics/IsSimpleParameterList.d.mts.map +1 -0
- package/declaration/static-semantics/IsStatic.d.mts +4 -0
- package/declaration/static-semantics/IsStatic.d.mts.map +1 -0
- package/declaration/static-semantics/IsStrict.d.mts +4 -0
- package/declaration/static-semantics/IsStrict.d.mts.map +1 -0
- package/declaration/static-semantics/IsStringWellFormedUnicode.d.mts +3 -0
- package/declaration/static-semantics/IsStringWellFormedUnicode.d.mts.map +1 -0
- package/declaration/static-semantics/IsUsingDeclaration.d.mts +3 -0
- package/declaration/static-semantics/IsUsingDeclaration.d.mts.map +1 -0
- package/declaration/static-semantics/LexicallyDeclaredNames.d.mts +4 -0
- package/declaration/static-semantics/LexicallyDeclaredNames.d.mts.map +1 -0
- package/declaration/static-semantics/LexicallyScopedDeclarations.d.mts +3 -0
- package/declaration/static-semantics/LexicallyScopedDeclarations.d.mts.map +1 -0
- package/declaration/static-semantics/ModuleRequests.d.mts +22 -0
- package/declaration/static-semantics/ModuleRequests.d.mts.map +1 -0
- package/declaration/static-semantics/NonConstructorElements.d.mts +4 -0
- package/declaration/static-semantics/NonConstructorElements.d.mts.map +1 -0
- package/declaration/static-semantics/NumericValue.d.mts +4 -0
- package/declaration/static-semantics/NumericValue.d.mts.map +1 -0
- package/declaration/static-semantics/PrivateBoundIdentifiers.d.mts +5 -0
- package/declaration/static-semantics/PrivateBoundIdentifiers.d.mts.map +1 -0
- package/declaration/static-semantics/PropName.d.mts +3 -0
- package/declaration/static-semantics/PropName.d.mts.map +1 -0
- package/declaration/static-semantics/StringToCodePoints.d.mts +3 -0
- package/declaration/static-semantics/StringToCodePoints.d.mts.map +1 -0
- package/declaration/static-semantics/StringValue.d.mts +3 -0
- package/declaration/static-semantics/StringValue.d.mts.map +1 -0
- package/declaration/static-semantics/TemplateStrings.d.mts +5 -0
- package/declaration/static-semantics/TemplateStrings.d.mts.map +1 -0
- package/declaration/static-semantics/TopLevelLexicallyDeclaredNames.d.mts +4 -0
- package/declaration/static-semantics/TopLevelLexicallyDeclaredNames.d.mts.map +1 -0
- package/declaration/static-semantics/TopLevelLexicallyScopedDeclarations.d.mts +4 -0
- package/declaration/static-semantics/TopLevelLexicallyScopedDeclarations.d.mts.map +1 -0
- package/declaration/static-semantics/TopLevelVarDeclaredNames.d.mts +4 -0
- package/declaration/static-semantics/TopLevelVarDeclaredNames.d.mts.map +1 -0
- package/declaration/static-semantics/TopLevelVarScopedDeclarations.d.mts +4 -0
- package/declaration/static-semantics/TopLevelVarScopedDeclarations.d.mts.map +1 -0
- package/declaration/static-semantics/UTF16EncodeCodePoint.d.mts +4 -0
- package/declaration/static-semantics/UTF16EncodeCodePoint.d.mts.map +1 -0
- package/declaration/static-semantics/UTF16SurrogatePairToCodePoint.d.mts +4 -0
- package/declaration/static-semantics/UTF16SurrogatePairToCodePoint.d.mts.map +1 -0
- package/declaration/static-semantics/VarDeclaredNames.d.mts +4 -0
- package/declaration/static-semantics/VarDeclaredNames.d.mts.map +1 -0
- package/declaration/static-semantics/VarScopedDeclarations.d.mts +4 -0
- package/declaration/static-semantics/VarScopedDeclarations.d.mts.map +1 -0
- package/declaration/static-semantics/all.d.mts +51 -0
- package/declaration/static-semantics/all.d.mts.map +1 -0
- package/declaration/utils/callback.d.mts +3 -0
- package/declaration/utils/callback.d.mts.map +1 -0
- package/declaration/utils/container.d.mts +54 -0
- package/declaration/utils/container.d.mts.map +1 -0
- package/declaration/utils/internal.d.mts +3 -0
- package/declaration/utils/internal.d.mts.map +1 -0
- package/declaration/utils/language.d.mts +13 -0
- package/declaration/utils/language.d.mts.map +1 -0
- package/declaration/utils/module-loader.d.mts +15 -0
- package/declaration/utils/module-loader.d.mts.map +1 -0
- package/declaration/utils/module-loaders/builtin-loader.d.mts +13 -0
- package/declaration/utils/module-loaders/builtin-loader.d.mts.map +1 -0
- package/declaration/utils/module.d.mts +15 -0
- package/declaration/utils/module.d.mts.map +1 -0
- package/declaration/utils/stack.d.mts +49 -0
- package/declaration/utils/stack.d.mts.map +1 -0
- package/declaration/value.d.mts +276 -0
- package/declaration/value.d.mts.map +1 -0
- package/lib/engine262.d.mts +1 -0
- package/lib/engine262.d.ts +1 -0
- package/lib/engine262.js +80493 -0
- package/lib/engine262.js.map +1 -0
- package/lib/engine262.mjs +79570 -0
- package/lib/engine262.mjs.map +1 -0
- package/lib/inspector/context.d.mts +39 -0
- package/lib/inspector/context.d.mts.map +1 -0
- package/lib/inspector/context.mjs +307 -0
- package/lib/inspector/context.mjs.map +1 -0
- package/lib/inspector/evaluator.d.mts +4 -0
- package/lib/inspector/evaluator.d.mts.map +1 -0
- package/lib/inspector/evaluator.mjs +16 -0
- package/lib/inspector/evaluator.mjs.map +1 -0
- package/lib/inspector/index.d.mts +17 -0
- package/lib/inspector/index.d.mts.map +1 -0
- package/lib/inspector/index.mjs +180 -0
- package/lib/inspector/index.mjs.map +1 -0
- package/lib/inspector/internal-utils.d.mts +4 -0
- package/lib/inspector/internal-utils.d.mts.map +1 -0
- package/lib/inspector/internal-utils.mjs +17 -0
- package/lib/inspector/internal-utils.mjs.map +1 -0
- package/lib/inspector/methods.d.mts +7 -0
- package/lib/inspector/methods.d.mts.map +1 -0
- package/lib/inspector/methods.mjs +368 -0
- package/lib/inspector/methods.mjs.map +1 -0
- package/lib/inspector/objects/RegExp.d.mts +4 -0
- package/lib/inspector/objects/RegExp.d.mts.map +1 -0
- package/lib/inspector/objects/RegExp.mjs +3 -0
- package/lib/inspector/objects/RegExp.mjs.map +1 -0
- package/lib/inspector/objects/arrays.d.mts +8 -0
- package/lib/inspector/objects/arrays.d.mts.map +1 -0
- package/lib/inspector/objects/arrays.mjs +72 -0
- package/lib/inspector/objects/arrays.mjs.map +1 -0
- package/lib/inspector/objects/collections.d.mts +7 -0
- package/lib/inspector/objects/collections.d.mts.map +1 -0
- package/lib/inspector/objects/collections.mjs +32 -0
- package/lib/inspector/objects/collections.mjs.map +1 -0
- package/lib/inspector/objects/dates.d.mts +12 -0
- package/lib/inspector/objects/dates.d.mts.map +1 -0
- package/lib/inspector/objects/dates.mjs +18 -0
- package/lib/inspector/objects/dates.mjs.map +1 -0
- package/lib/inspector/objects/errors.d.mts +4 -0
- package/lib/inspector/objects/errors.d.mts.map +1 -0
- package/lib/inspector/objects/errors.mjs +51 -0
- package/lib/inspector/objects/errors.mjs.map +1 -0
- package/lib/inspector/objects/function.d.mts +4 -0
- package/lib/inspector/objects/function.d.mts.map +1 -0
- package/lib/inspector/objects/function.mjs +137 -0
- package/lib/inspector/objects/function.mjs.map +1 -0
- package/lib/inspector/objects/index.d.mts +13 -0
- package/lib/inspector/objects/index.d.mts.map +1 -0
- package/lib/inspector/objects/index.mjs +84 -0
- package/lib/inspector/objects/index.mjs.map +1 -0
- package/lib/inspector/objects/modules.d.mts +4 -0
- package/lib/inspector/objects/modules.d.mts.map +1 -0
- package/lib/inspector/objects/modules.mjs +57 -0
- package/lib/inspector/objects/modules.mjs.map +1 -0
- package/lib/inspector/objects/objects.d.mts +31 -0
- package/lib/inspector/objects/objects.d.mts.map +1 -0
- package/lib/inspector/objects/objects.mjs +166 -0
- package/lib/inspector/objects/objects.mjs.map +1 -0
- package/lib/inspector/objects/primitives.d.mts +9 -0
- package/lib/inspector/objects/primitives.d.mts.map +1 -0
- package/lib/inspector/objects/primitives.mjs +105 -0
- package/lib/inspector/objects/primitives.mjs.map +1 -0
- package/lib/inspector/objects/promises.d.mts +4 -0
- package/lib/inspector/objects/promises.d.mts.map +1 -0
- package/lib/inspector/objects/promises.mjs +6 -0
- package/lib/inspector/objects/promises.mjs.map +1 -0
- package/lib/inspector/objects/proxies.d.mts +4 -0
- package/lib/inspector/objects/proxies.d.mts.map +1 -0
- package/lib/inspector/objects/proxies.mjs +12 -0
- package/lib/inspector/objects/proxies.mjs.map +1 -0
- package/lib/inspector/objects/shadow-realms.d.mts +4 -0
- package/lib/inspector/objects/shadow-realms.d.mts.map +1 -0
- package/lib/inspector/objects/shadow-realms.mjs +5 -0
- package/lib/inspector/objects/shadow-realms.mjs.map +1 -0
- package/lib/inspector/types.d.mts +223 -0
- package/lib/inspector/types.d.mts.map +1 -0
- package/lib/inspector/types.mjs +2 -0
- package/lib/inspector/types.mjs.map +1 -0
- package/lib/inspector/utils.d.mts +8 -0
- package/lib/inspector/utils.d.mts.map +1 -0
- package/lib/inspector/utils.mjs +61 -0
- package/lib/inspector/utils.mjs.map +1 -0
- package/lib/inspector.d.mts +1 -0
- package/lib/inspector.d.ts +1 -0
- package/lib/inspector.js +1888 -0
- package/lib/inspector.js.map +1 -0
- package/lib/inspector.mjs +1881 -0
- package/lib/inspector.mjs.map +1 -0
- package/lib/node/bin.d.mts +3 -0
- package/lib/node/bin.d.mts.map +1 -0
- package/lib/node/bin.mjs +312 -0
- package/lib/node/bin.mjs.map +1 -0
- package/lib/node/example.d.mts +2 -0
- package/lib/node/example.d.mts.map +1 -0
- package/lib/node/example.mjs +153 -0
- package/lib/node/example.mjs.map +1 -0
- package/lib/node/inspector.d.mts +17 -0
- package/lib/node/inspector.d.mts.map +1 -0
- package/lib/node/inspector.mjs +138 -0
- package/lib/node/inspector.mjs.map +1 -0
- package/lib/node/module.d.mts +23 -0
- package/lib/node/module.d.mts.map +1 -0
- package/lib/node/module.mjs +205 -0
- package/lib/node/module.mjs.map +1 -0
- package/lib/test262-harness.json +45 -0
- package/lib-src/inspector/context.mts +361 -0
- package/lib-src/inspector/evaluator.mts +19 -0
- package/lib-src/inspector/index.mts +209 -0
- package/lib-src/inspector/internal-utils.mts +18 -0
- package/lib-src/inspector/js_protocol.json +3288 -0
- package/lib-src/inspector/methods.mts +400 -0
- package/lib-src/inspector/objects/RegExp.mts +4 -0
- package/lib-src/inspector/objects/arrays.mts +78 -0
- package/lib-src/inspector/objects/collections.mts +37 -0
- package/lib-src/inspector/objects/dates.mts +49 -0
- package/lib-src/inspector/objects/errors.mts +58 -0
- package/lib-src/inspector/objects/function.mts +154 -0
- package/lib-src/inspector/objects/index.mts +134 -0
- package/lib-src/inspector/objects/modules.mts +60 -0
- package/lib-src/inspector/objects/objects.mts +211 -0
- package/lib-src/inspector/objects/primitives.mts +119 -0
- package/lib-src/inspector/objects/promises.mts +6 -0
- package/lib-src/inspector/objects/proxies.mts +12 -0
- package/lib-src/inspector/objects/shadow-realms.mts +6 -0
- package/lib-src/inspector/tsconfig.json +17 -0
- package/lib-src/inspector/types.mts +228 -0
- package/lib-src/inspector/utils.mts +83 -0
- package/lib-src/node/bin.mts +339 -0
- package/lib-src/node/example.mts +173 -0
- package/lib-src/node/inspector.mts +152 -0
- package/lib-src/node/module.mts +233 -0
- package/lib-src/node/tsconfig.json +21 -0
- package/package.json +147 -0
- package/src/abstract-ops/all.mts +38 -0
- package/src/abstract-ops/arguments-operations.mts +246 -0
- package/src/abstract-ops/array-objects.mts +311 -0
- package/src/abstract-ops/arraybuffer-objects.mts +361 -0
- package/src/abstract-ops/async-function-operations.mts +46 -0
- package/src/abstract-ops/async-generator-objects.mts +320 -0
- package/src/abstract-ops/data-types-and-values.mts +43 -0
- package/src/abstract-ops/dataview-objects.mts +147 -0
- package/src/abstract-ops/date-objects.mts +226 -0
- package/src/abstract-ops/disposable-operations.mts +166 -0
- package/src/abstract-ops/error-objects.mts +38 -0
- package/src/abstract-ops/execution-contexts.mts +18 -0
- package/src/abstract-ops/function-operations.mts +740 -0
- package/src/abstract-ops/generator-operations.mts +298 -0
- package/src/abstract-ops/global-object.mts +394 -0
- package/src/abstract-ops/immutable-prototype-objects.mts +21 -0
- package/src/abstract-ops/import-calls.mts +153 -0
- package/src/abstract-ops/iterator-operations.mts +409 -0
- package/src/abstract-ops/keyed-collections.mts +15 -0
- package/src/abstract-ops/math.mts +72 -0
- package/src/abstract-ops/module-namespace-exotic-objects.mts +277 -0
- package/src/abstract-ops/module-records.mts +1044 -0
- package/src/abstract-ops/notational-conventions.mts +67 -0
- package/src/abstract-ops/object-operations.mts +623 -0
- package/src/abstract-ops/objects.mts +453 -0
- package/src/abstract-ops/private-names.mts +170 -0
- package/src/abstract-ops/promise-operations.mts +444 -0
- package/src/abstract-ops/proxy-objects.mts +580 -0
- package/src/abstract-ops/realms.mts +209 -0
- package/src/abstract-ops/reference-operations.mts +211 -0
- package/src/abstract-ops/regexp-objects.mts +310 -0
- package/src/abstract-ops/shadow-realm.mts +216 -0
- package/src/abstract-ops/shared-arraybuffer.mts +8 -0
- package/src/abstract-ops/spec-types.mts +251 -0
- package/src/abstract-ops/string-objects.mts +156 -0
- package/src/abstract-ops/symbol-objects.mts +35 -0
- package/src/abstract-ops/temporal/addition.mts +221 -0
- package/src/abstract-ops/temporal/all.mts +12 -0
- package/src/abstract-ops/temporal/calendar.mts +801 -0
- package/src/abstract-ops/temporal/duration.mts +1015 -0
- package/src/abstract-ops/temporal/instant.mts +174 -0
- package/src/abstract-ops/temporal/not-implemented.mts +15 -0
- package/src/abstract-ops/temporal/now.mts +46 -0
- package/src/abstract-ops/temporal/plain-date-time.mts +242 -0
- package/src/abstract-ops/temporal/plain-date.mts +249 -0
- package/src/abstract-ops/temporal/plain-month-day.mts +86 -0
- package/src/abstract-ops/temporal/plain-time.mts +331 -0
- package/src/abstract-ops/temporal/plain-year-month.mts +195 -0
- package/src/abstract-ops/temporal/temporal.mts +837 -0
- package/src/abstract-ops/temporal/time-zone.mts +304 -0
- package/src/abstract-ops/temporal/zoned-datetime.mts +373 -0
- package/src/abstract-ops/testing-comparison.mts +376 -0
- package/src/abstract-ops/type-conversion.mts +514 -0
- package/src/abstract-ops/typedarray-objects.mts +385 -0
- package/src/abstract-ops/weak-operations.mts +20 -0
- package/src/api.mts +359 -0
- package/src/completion.mts +477 -0
- package/src/ecma402/not-implemented.mts +4 -0
- package/src/evaluator.mts +384 -0
- package/src/execution-context/Agent.mts +481 -0
- package/src/execution-context/Environment.mts +994 -0
- package/src/execution-context/ExecutionContext.mts +248 -0
- package/src/execution-context/Job.mts +64 -0
- package/src/execution-context/PrivateEnvironment.mts +41 -0
- package/src/execution-context/Realm.mts +378 -0
- package/src/execution-context/WeakReference.mts +86 -0
- package/src/execution-context/all.mts +7 -0
- package/src/host-defined/base64.mts +58 -0
- package/src/host-defined/debugger-util.mts +15 -0
- package/src/host-defined/decimal.mts +117 -0
- package/src/host-defined/devtoolsEval.mts +150 -0
- package/src/host-defined/engine.mts +283 -0
- package/src/host-defined/error-messages.mts +637 -0
- package/src/host-defined/event-loop.mts +311 -0
- package/src/host-defined/ieee754.mts +212 -0
- package/src/host-defined/inspect.mts +250 -0
- package/src/host-defined/job-queue.mts +191 -0
- package/src/host-defined/sort.mts +860 -0
- package/src/host-defined/test262-intrinsics.mts +167 -0
- package/src/index.mts +66 -0
- package/src/intrinsics/AbstractModuleSource.mts +47 -0
- package/src/intrinsics/AggregateError.mts +66 -0
- package/src/intrinsics/AggregateErrorPrototype.mts +12 -0
- package/src/intrinsics/Array.mts +302 -0
- package/src/intrinsics/ArrayBuffer.mts +48 -0
- package/src/intrinsics/ArrayBufferPrototype.mts +189 -0
- package/src/intrinsics/ArrayIteratorPrototype.mts +23 -0
- package/src/intrinsics/ArrayPrototype.mts +688 -0
- package/src/intrinsics/ArrayPrototypeShared.mts +572 -0
- package/src/intrinsics/AsyncDisposableStack.mts +36 -0
- package/src/intrinsics/AsyncDisposableStackPrototype.mts +103 -0
- package/src/intrinsics/AsyncFromSyncIteratorPrototype.mts +165 -0
- package/src/intrinsics/AsyncFunction.mts +33 -0
- package/src/intrinsics/AsyncFunctionPrototype.mts +8 -0
- package/src/intrinsics/AsyncGeneratorFunction.mts +39 -0
- package/src/intrinsics/AsyncGeneratorFunctionPrototype.mts +19 -0
- package/src/intrinsics/AsyncGeneratorFunctionPrototypePrototype.mts +148 -0
- package/src/intrinsics/AsyncIteratorPrototype.mts +56 -0
- package/src/intrinsics/BigInt.mts +69 -0
- package/src/intrinsics/BigIntPrototype.mts +64 -0
- package/src/intrinsics/Boolean.mts +47 -0
- package/src/intrinsics/BooleanPrototype.mts +56 -0
- package/src/intrinsics/DataView.mts +81 -0
- package/src/intrinsics/DataViewPrototype.mts +284 -0
- package/src/intrinsics/Date.mts +243 -0
- package/src/intrinsics/DatePrototype.mts +771 -0
- package/src/intrinsics/DisposableStack.mts +41 -0
- package/src/intrinsics/DisposableStackPrototype.mts +103 -0
- package/src/intrinsics/Error.mts +106 -0
- package/src/intrinsics/ErrorPrototype.mts +100 -0
- package/src/intrinsics/FinalizationRegistry.mts +69 -0
- package/src/intrinsics/FinalizationRegistryPrototype.mts +110 -0
- package/src/intrinsics/ForInIteratorPrototype.mts +120 -0
- package/src/intrinsics/Function.mts +24 -0
- package/src/intrinsics/FunctionPrototype.mts +232 -0
- package/src/intrinsics/GeneratorFunction.mts +38 -0
- package/src/intrinsics/GeneratorFunctionPrototype.mts +22 -0
- package/src/intrinsics/GeneratorFunctionPrototypePrototype.mts +59 -0
- package/src/intrinsics/Iterator.mts +302 -0
- package/src/intrinsics/IteratorHelperPrototype.mts +61 -0
- package/src/intrinsics/IteratorPrototype.mts +700 -0
- package/src/intrinsics/JSON.mts +740 -0
- package/src/intrinsics/Map.mts +129 -0
- package/src/intrinsics/MapIteratorPrototype.mts +81 -0
- package/src/intrinsics/MapPrototype.mts +295 -0
- package/src/intrinsics/Math.mts +605 -0
- package/src/intrinsics/NativeError.mts +86 -0
- package/src/intrinsics/Number.mts +135 -0
- package/src/intrinsics/NumberPrototype.mts +116 -0
- package/src/intrinsics/Object.mts +466 -0
- package/src/intrinsics/ObjectPrototype.mts +333 -0
- package/src/intrinsics/Promise.mts +807 -0
- package/src/intrinsics/PromisePrototype.mts +126 -0
- package/src/intrinsics/Proxy.mts +101 -0
- package/src/intrinsics/Reflect.mts +211 -0
- package/src/intrinsics/RegExp.mts +166 -0
- package/src/intrinsics/RegExpPrototype.mts +762 -0
- package/src/intrinsics/RegExpStringIteratorPrototype.mts +73 -0
- package/src/intrinsics/Set.mts +75 -0
- package/src/intrinsics/SetIteratorPrototype.mts +78 -0
- package/src/intrinsics/SetPrototype.mts +684 -0
- package/src/intrinsics/ShadowRealm.mts +71 -0
- package/src/intrinsics/ShadowRealmPrototype.mts +47 -0
- package/src/intrinsics/String.mts +138 -0
- package/src/intrinsics/StringIteratorPrototype.mts +23 -0
- package/src/intrinsics/StringPrototype.mts +813 -0
- package/src/intrinsics/SuppressedError.mts +53 -0
- package/src/intrinsics/SuppressedErrorPrototype.mts +11 -0
- package/src/intrinsics/Symbol.mts +99 -0
- package/src/intrinsics/SymbolPrototype.mts +81 -0
- package/src/intrinsics/Temporal/Duration.mts +140 -0
- package/src/intrinsics/Temporal/DurationPrototype.mts +425 -0
- package/src/intrinsics/Temporal/Instant.mts +90 -0
- package/src/intrinsics/Temporal/InstantPrototype.mts +211 -0
- package/src/intrinsics/Temporal/Now.mts +66 -0
- package/src/intrinsics/Temporal/PlainDate.mts +79 -0
- package/src/intrinsics/Temporal/PlainDatePrototype.mts +331 -0
- package/src/intrinsics/Temporal/PlainDateTime.mts +113 -0
- package/src/intrinsics/Temporal/PlainDateTimePrototype.mts +418 -0
- package/src/intrinsics/Temporal/PlainMonthDay.mts +81 -0
- package/src/intrinsics/Temporal/PlainMonthDayPrototype.mts +139 -0
- package/src/intrinsics/Temporal/PlainTime.mts +74 -0
- package/src/intrinsics/Temporal/PlainTimePrototype.mts +224 -0
- package/src/intrinsics/Temporal/PlainYearMonth.mts +96 -0
- package/src/intrinsics/Temporal/PlainYearMonthPrototype.mts +223 -0
- package/src/intrinsics/Temporal/Temporal.mts +30 -0
- package/src/intrinsics/Temporal/ZonedDateTime.mts +103 -0
- package/src/intrinsics/Temporal/ZonedDateTimePrototype.mts +601 -0
- package/src/intrinsics/ThrowTypeError.mts +21 -0
- package/src/intrinsics/TypedArray.mts +585 -0
- package/src/intrinsics/TypedArrayConstructors.mts +85 -0
- package/src/intrinsics/TypedArrayPrototype.mts +600 -0
- package/src/intrinsics/TypedArrayPrototypes.mts +17 -0
- package/src/intrinsics/TypedArray_Uint8Array.mts +438 -0
- package/src/intrinsics/URIHandling.mts +277 -0
- package/src/intrinsics/WeakMap.mts +56 -0
- package/src/intrinsics/WeakMapPrototype.mts +203 -0
- package/src/intrinsics/WeakRef.mts +43 -0
- package/src/intrinsics/WeakRefPrototype.mts +23 -0
- package/src/intrinsics/WeakSet.mts +66 -0
- package/src/intrinsics/WeakSetPrototype.mts +100 -0
- package/src/intrinsics/WrapForValidIteratorPrototype.mts +65 -0
- package/src/intrinsics/bootstrap.mts +153 -0
- package/src/intrinsics/eval.mts +16 -0
- package/src/intrinsics/isFinite.mts +23 -0
- package/src/intrinsics/isNaN.mts +23 -0
- package/src/intrinsics/parseFloat.mts +78 -0
- package/src/intrinsics/parseInt.mts +85 -0
- package/src/modules.mts +1088 -0
- package/src/parse.mts +267 -0
- package/src/parser/BaseParser.mts +36 -0
- package/src/parser/ExpressionParser.mts +1697 -0
- package/src/parser/FunctionParser.mts +398 -0
- package/src/parser/IdentifierParser.mts +149 -0
- package/src/parser/LanguageParser.mts +140 -0
- package/src/parser/Lexer.mts +1190 -0
- package/src/parser/ModuleParser.mts +429 -0
- package/src/parser/ParseNode.mts +2923 -0
- package/src/parser/Parser.mts +88 -0
- package/src/parser/RegExpParser.mts +1428 -0
- package/src/parser/Scope.mts +571 -0
- package/src/parser/StatementParser.mts +1160 -0
- package/src/parser/TemporalParser.mts +1245 -0
- package/src/parser/tokens.mts +210 -0
- package/src/parser/unicode.d.ts +20 -0
- package/src/parser/utils.mts +114 -0
- package/src/runtime-semantics/AdditiveExpression.mts +29 -0
- package/src/runtime-semantics/ApplyStringOrNumericBinaryOperator.mts +78 -0
- package/src/runtime-semantics/ArgumentListEvaluation.mts +178 -0
- package/src/runtime-semantics/ArrayLiteral.mts +99 -0
- package/src/runtime-semantics/ArrowFunction.mts +8 -0
- package/src/runtime-semantics/AssignmentExpression.mts +284 -0
- package/src/runtime-semantics/AsyncArrowFunction.mts +8 -0
- package/src/runtime-semantics/AsyncFunctionExpression.mts +11 -0
- package/src/runtime-semantics/AsyncGeneratorExpression.mts +11 -0
- package/src/runtime-semantics/AwaitExpression.mts +16 -0
- package/src/runtime-semantics/BindingInitialization.mts +91 -0
- package/src/runtime-semantics/BitwiseOperators.mts +14 -0
- package/src/runtime-semantics/Block.mts +73 -0
- package/src/runtime-semantics/BreakStatement.mts +18 -0
- package/src/runtime-semantics/BreakableStatement.mts +18 -0
- package/src/runtime-semantics/CallExpression.mts +57 -0
- package/src/runtime-semantics/ClassDeclaration.mts +41 -0
- package/src/runtime-semantics/ClassDefinitionEvaluation.mts +811 -0
- package/src/runtime-semantics/ClassExpression.mts +24 -0
- package/src/runtime-semantics/ClassFieldDefinitionEvaluation.mts +189 -0
- package/src/runtime-semantics/ClassStaticBlockDefinitionEvaluation.mts +48 -0
- package/src/runtime-semantics/CoalesceExpression.mts +24 -0
- package/src/runtime-semantics/CommaOperator.mts +18 -0
- package/src/runtime-semantics/ConditionalExpression.mts +31 -0
- package/src/runtime-semantics/ContinueStatement.mts +18 -0
- package/src/runtime-semantics/CreateDynamicFunction.mts +161 -0
- package/src/runtime-semantics/DebuggerStatement.mts +20 -0
- package/src/runtime-semantics/DefineMethod.mts +42 -0
- package/src/runtime-semantics/DestructuringAssignmentEvaluation.mts +306 -0
- package/src/runtime-semantics/EmptyStatement.mts +9 -0
- package/src/runtime-semantics/EqualityExpression.mts +60 -0
- package/src/runtime-semantics/EvaluateBody.mts +211 -0
- package/src/runtime-semantics/EvaluateCall.mts +67 -0
- package/src/runtime-semantics/EvaluatePropertyAccess.mts +39 -0
- package/src/runtime-semantics/EvaluateStringOrNumericBinaryExpression.mts +19 -0
- package/src/runtime-semantics/ExponentiationExpression.mts +11 -0
- package/src/runtime-semantics/ExportDeclaration.mts +100 -0
- package/src/runtime-semantics/ExpressionStatement.mts +14 -0
- package/src/runtime-semantics/ForDeclarationBindingInitialization.mts +21 -0
- package/src/runtime-semantics/FunctionDeclaration.mts +10 -0
- package/src/runtime-semantics/FunctionDeclarationInstantiation.mts +273 -0
- package/src/runtime-semantics/FunctionExpression.mts +10 -0
- package/src/runtime-semantics/FunctionStatementList.mts +17 -0
- package/src/runtime-semantics/GeneratorExpression.mts +11 -0
- package/src/runtime-semantics/GetSubstitution.mts +90 -0
- package/src/runtime-semantics/GlobalDeclarationInstantiation.mts +140 -0
- package/src/runtime-semantics/HoistableDeclaration.mts +12 -0
- package/src/runtime-semantics/IdentifierReference.mts +15 -0
- package/src/runtime-semantics/IfStatement.mts +49 -0
- package/src/runtime-semantics/ImportCall.mts +137 -0
- package/src/runtime-semantics/ImportDeclaration.mts +9 -0
- package/src/runtime-semantics/ImportMeta.mts +45 -0
- package/src/runtime-semantics/InstantiateArrowFunctionExpression.mts +36 -0
- package/src/runtime-semantics/InstantiateAsyncArrowFunctionExpression.mts +38 -0
- package/src/runtime-semantics/InstantiateAsyncFunctionExpression.mts +75 -0
- package/src/runtime-semantics/InstantiateAsyncGeneratorFunctionExpression.mts +90 -0
- package/src/runtime-semantics/InstantiateFunctionObject.mts +123 -0
- package/src/runtime-semantics/InstantiateGeneratorFunctionExpression.mts +82 -0
- package/src/runtime-semantics/InstantiateOrdinaryFunctionExpression.mts +64 -0
- package/src/runtime-semantics/IteratorBindingInitialization.mts +212 -0
- package/src/runtime-semantics/KeyedBindingInitialization.mts +61 -0
- package/src/runtime-semantics/LabelledEvaluation.mts +749 -0
- package/src/runtime-semantics/LabelledStatement.mts +11 -0
- package/src/runtime-semantics/LexicalDeclaration.mts +114 -0
- package/src/runtime-semantics/Literal.mts +36 -0
- package/src/runtime-semantics/LogicalANDExpression.mts +25 -0
- package/src/runtime-semantics/LogicalORExpression.mts +25 -0
- package/src/runtime-semantics/MV.mts +10 -0
- package/src/runtime-semantics/MemberExpression.mts +71 -0
- package/src/runtime-semantics/MethodDefinitionEvaluation.mts +364 -0
- package/src/runtime-semantics/Module.mts +15 -0
- package/src/runtime-semantics/ModuleBody.mts +10 -0
- package/src/runtime-semantics/MultiplicativeExpression.mts +18 -0
- package/src/runtime-semantics/NamedEvaluation.mts +97 -0
- package/src/runtime-semantics/NewExpression.mts +51 -0
- package/src/runtime-semantics/NewTarget.mts +8 -0
- package/src/runtime-semantics/NumberToBigInt.mts +16 -0
- package/src/runtime-semantics/ObjectLiteral.mts +25 -0
- package/src/runtime-semantics/OptionalExpression.mts +129 -0
- package/src/runtime-semantics/ParenthesizedExpression.mts +8 -0
- package/src/runtime-semantics/PropertyBindingInitialization.mts +45 -0
- package/src/runtime-semantics/PropertyDefinitionEvaluation.mts +132 -0
- package/src/runtime-semantics/PropertyName.mts +62 -0
- package/src/runtime-semantics/RegExp.mts +1344 -0
- package/src/runtime-semantics/RegularExpressionLiteral.mts +16 -0
- package/src/runtime-semantics/RelationalExpression.mts +150 -0
- package/src/runtime-semantics/RestBindingInitialization.mts +29 -0
- package/src/runtime-semantics/ReturnStatement.mts +32 -0
- package/src/runtime-semantics/Script.mts +15 -0
- package/src/runtime-semantics/ScriptBody.mts +7 -0
- package/src/runtime-semantics/ShiftExpression.mts +17 -0
- package/src/runtime-semantics/StatementList.mts +33 -0
- package/src/runtime-semantics/StringIndexOf.mts +43 -0
- package/src/runtime-semantics/StringPad.mts +34 -0
- package/src/runtime-semantics/SuperCall.mts +65 -0
- package/src/runtime-semantics/SuperProperty.mts +58 -0
- package/src/runtime-semantics/SwitchStatement.mts +214 -0
- package/src/runtime-semantics/TaggedTemplateExpression.mts +23 -0
- package/src/runtime-semantics/TemplateLiteral.mts +34 -0
- package/src/runtime-semantics/This.mts +9 -0
- package/src/runtime-semantics/ThrowStatement.mts +23 -0
- package/src/runtime-semantics/TrimString.mts +19 -0
- package/src/runtime-semantics/TryStatement.mts +119 -0
- package/src/runtime-semantics/UnaryExpression.mts +218 -0
- package/src/runtime-semantics/Unicode.mts +268 -0
- package/src/runtime-semantics/UpdateExpression.mts +126 -0
- package/src/runtime-semantics/VariableStatement.mts +72 -0
- package/src/runtime-semantics/WithStatement.mts +33 -0
- package/src/runtime-semantics/YieldExpression.mts +175 -0
- package/src/runtime-semantics/all.mts +109 -0
- package/src/static-semantics/BodyText.mts +7 -0
- package/src/static-semantics/BoundNames.mts +108 -0
- package/src/static-semantics/CharacterValue.mts +112 -0
- package/src/static-semantics/CodePointAt.mts +53 -0
- package/src/static-semantics/CodePointsToString.mts +15 -0
- package/src/static-semantics/ConstructorMethod.mts +10 -0
- package/src/static-semantics/ContainsArguments.mts +33 -0
- package/src/static-semantics/ContainsExpression.mts +59 -0
- package/src/static-semantics/ContainsUsing.mts +15 -0
- package/src/static-semantics/DeclarationPart.mts +5 -0
- package/src/static-semantics/ExpectedArgumentCount.mts +26 -0
- package/src/static-semantics/ExportEntries.mts +183 -0
- package/src/static-semantics/ExportEntriesForModule.mts +79 -0
- package/src/static-semantics/FlagText.mts +7 -0
- package/src/static-semantics/HasInitializer.mts +5 -0
- package/src/static-semantics/HasName.mts +8 -0
- package/src/static-semantics/ImportEntries.mts +49 -0
- package/src/static-semantics/ImportEntriesForModule.mts +110 -0
- package/src/static-semantics/ImportedLocalNames.mts +14 -0
- package/src/static-semantics/IsAnonymousFunctionDefinition.mts +18 -0
- package/src/static-semantics/IsAwaitUsingDeclaration.mts +12 -0
- package/src/static-semantics/IsComputedPropertyKey.mts +7 -0
- package/src/static-semantics/IsConstantDeclaration.mts +11 -0
- package/src/static-semantics/IsDestructuring.mts +21 -0
- package/src/static-semantics/IsFunctionDefinition.mts +15 -0
- package/src/static-semantics/IsIdentifierRef.mts +5 -0
- package/src/static-semantics/IsInTailPosition.mts +5 -0
- package/src/static-semantics/IsSimpleParameterList.mts +23 -0
- package/src/static-semantics/IsStatic.mts +10 -0
- package/src/static-semantics/IsStrict.mts +7 -0
- package/src/static-semantics/IsStringWellFormedUnicode.mts +24 -0
- package/src/static-semantics/IsUsingDeclaration.mts +12 -0
- package/src/static-semantics/LexicallyDeclaredNames.mts +26 -0
- package/src/static-semantics/LexicallyScopedDeclarations.mts +84 -0
- package/src/static-semantics/ModuleRequests.mts +185 -0
- package/src/static-semantics/NonConstructorElements.mts +15 -0
- package/src/static-semantics/NumericValue.mts +7 -0
- package/src/static-semantics/PrivateBoundIdentifiers.mts +23 -0
- package/src/static-semantics/PropName.mts +23 -0
- package/src/static-semantics/StringToCodePoints.mts +22 -0
- package/src/static-semantics/StringValue.mts +19 -0
- package/src/static-semantics/TemplateStrings.mts +109 -0
- package/src/static-semantics/TopLevelLexicallyDeclaredNames.mts +23 -0
- package/src/static-semantics/TopLevelLexicallyScopedDeclarations.mts +27 -0
- package/src/static-semantics/TopLevelVarDeclaredNames.mts +28 -0
- package/src/static-semantics/TopLevelVarScopedDeclarations.mts +36 -0
- package/src/static-semantics/UTF16EncodeCodePoint.mts +19 -0
- package/src/static-semantics/UTF16SurrogatePairToCodePoint.mts +12 -0
- package/src/static-semantics/VarDeclaredNames.mts +109 -0
- package/src/static-semantics/VarScopedDeclarations.mts +115 -0
- package/src/static-semantics/all.mts +50 -0
- package/src/tsconfig.json +12 -0
- package/src/unicode/.gitkeep +0 -0
- package/src/unicode/CodePointProperties.json +1 -0
- package/src/unicode/PropertyValueAliases.json +434 -0
- package/src/unicode/SequenceProperties.json +1 -0
- package/src/utils/callback.mts +7 -0
- package/src/utils/container.mts +284 -0
- package/src/utils/internal.mts +2 -0
- package/src/utils/language.mts +35 -0
- package/src/utils/module-loader.mts +73 -0
- package/src/utils/module-loaders/builtin-loader.mts +84 -0
- package/src/utils/module.mts +75 -0
- package/src/utils/stack.mts +324 -0
- package/src/value.mts +996 -0
package/lib/inspector.js
ADDED
|
@@ -0,0 +1,1888 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* engine262 0.0.1 01e9fa95a4e8a1c042efd00492309a2de4998fd0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2018 engine262 Contributors
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to
|
|
8
|
+
* deal in the Software without restriction, including without limitation the
|
|
9
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
10
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
|
14
|
+
* all copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
22
|
+
* IN THE SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
(function (global, factory) {
|
|
26
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('./engine262.mjs')) :
|
|
27
|
+
typeof define === 'function' && define.amd ? define(['exports', './engine262.mjs'], factory) :
|
|
28
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@engine262/engine262/inspector"] = {}, global["@engine262/engine262"]));
|
|
29
|
+
})(this, (function (exports, engine262_mjs) { 'use strict';
|
|
30
|
+
|
|
31
|
+
const Null = {
|
|
32
|
+
toRemoteObject: () => ({
|
|
33
|
+
type: 'object',
|
|
34
|
+
subtype: 'null',
|
|
35
|
+
value: null
|
|
36
|
+
}),
|
|
37
|
+
toObjectPreview: () => ({
|
|
38
|
+
type: 'object',
|
|
39
|
+
subtype: 'null',
|
|
40
|
+
properties: [],
|
|
41
|
+
overflow: false
|
|
42
|
+
}),
|
|
43
|
+
toPropertyPreview: name => ({
|
|
44
|
+
name,
|
|
45
|
+
type: 'object',
|
|
46
|
+
subtype: 'null',
|
|
47
|
+
value: 'null'
|
|
48
|
+
}),
|
|
49
|
+
toDescription: () => ''
|
|
50
|
+
};
|
|
51
|
+
const Undefined = {
|
|
52
|
+
toRemoteObject: () => ({
|
|
53
|
+
type: 'undefined'
|
|
54
|
+
}),
|
|
55
|
+
toObjectPreview: () => ({
|
|
56
|
+
type: 'undefined',
|
|
57
|
+
properties: [],
|
|
58
|
+
overflow: false
|
|
59
|
+
}),
|
|
60
|
+
toPropertyPreview: name => ({
|
|
61
|
+
name,
|
|
62
|
+
type: 'undefined',
|
|
63
|
+
value: 'undefined'
|
|
64
|
+
}),
|
|
65
|
+
toDescription: () => 'undefined'
|
|
66
|
+
};
|
|
67
|
+
const Boolean$1 = {
|
|
68
|
+
toRemoteObject: value => ({
|
|
69
|
+
type: 'boolean',
|
|
70
|
+
value: value.booleanValue()
|
|
71
|
+
}),
|
|
72
|
+
toPropertyPreview: (name, value) => ({
|
|
73
|
+
name,
|
|
74
|
+
type: 'boolean',
|
|
75
|
+
value: value.booleanValue().toString()
|
|
76
|
+
}),
|
|
77
|
+
toObjectPreview(value) {
|
|
78
|
+
return {
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
value: value.booleanValue(),
|
|
81
|
+
description: value.booleanValue().toString(),
|
|
82
|
+
overflow: false,
|
|
83
|
+
properties: []
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
toDescription: value => value.booleanValue().toString()
|
|
87
|
+
};
|
|
88
|
+
const Symbol$1 = {
|
|
89
|
+
toRemoteObject: (value, getObjectId) => ({
|
|
90
|
+
type: 'symbol',
|
|
91
|
+
description: engine262_mjs.SymbolDescriptiveString(value).stringValue(),
|
|
92
|
+
objectId: getObjectId(value)
|
|
93
|
+
}),
|
|
94
|
+
toPropertyPreview: (name, value) => ({
|
|
95
|
+
name,
|
|
96
|
+
type: 'symbol',
|
|
97
|
+
value: engine262_mjs.SymbolDescriptiveString(value).stringValue()
|
|
98
|
+
}),
|
|
99
|
+
toObjectPreview: value => ({
|
|
100
|
+
type: 'symbol',
|
|
101
|
+
description: engine262_mjs.SymbolDescriptiveString(value).stringValue(),
|
|
102
|
+
overflow: false,
|
|
103
|
+
properties: []
|
|
104
|
+
}),
|
|
105
|
+
toDescription: value => engine262_mjs.SymbolDescriptiveString(value).stringValue()
|
|
106
|
+
};
|
|
107
|
+
const String$1 = {
|
|
108
|
+
toRemoteObject: value => ({
|
|
109
|
+
type: 'string',
|
|
110
|
+
value: value.stringValue()
|
|
111
|
+
}),
|
|
112
|
+
toPropertyPreview(name, value) {
|
|
113
|
+
return {
|
|
114
|
+
name,
|
|
115
|
+
type: 'string',
|
|
116
|
+
value: value.stringValue()
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
toObjectPreview(value) {
|
|
120
|
+
return {
|
|
121
|
+
type: 'string',
|
|
122
|
+
description: value.stringValue(),
|
|
123
|
+
overflow: false,
|
|
124
|
+
properties: []
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
toDescription: value => value.stringValue()
|
|
128
|
+
};
|
|
129
|
+
const Number = {
|
|
130
|
+
toRemoteObject(value) {
|
|
131
|
+
const v = value.value;
|
|
132
|
+
let description = v.toString();
|
|
133
|
+
const isNeg0 = Object.is(v, -0);
|
|
134
|
+
// Includes values `-0`, `NaN`, `Infinity`, `-Infinity`, and bigint literals.
|
|
135
|
+
if (isNeg0 || !globalThis.Number.isFinite(v)) {
|
|
136
|
+
if (typeof v === 'bigint') {
|
|
137
|
+
description += 'n';
|
|
138
|
+
return {
|
|
139
|
+
type: 'bigint',
|
|
140
|
+
unserializableValue: description,
|
|
141
|
+
description
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
type: 'number',
|
|
146
|
+
unserializableValue: description,
|
|
147
|
+
description: isNeg0 ? '-0' : description
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
type: 'number',
|
|
152
|
+
value: v,
|
|
153
|
+
description
|
|
154
|
+
};
|
|
155
|
+
},
|
|
156
|
+
toPropertyPreview(name, value, context) {
|
|
157
|
+
return {
|
|
158
|
+
name,
|
|
159
|
+
type: 'number',
|
|
160
|
+
value: this.toDescription(value, context)
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
toObjectPreview(value, context) {
|
|
164
|
+
return {
|
|
165
|
+
type: 'number',
|
|
166
|
+
description: this.toDescription(value, context),
|
|
167
|
+
overflow: false,
|
|
168
|
+
properties: []
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
toDescription: value => {
|
|
172
|
+
const r = value.value;
|
|
173
|
+
return value instanceof engine262_mjs.BigIntValue ? `${r}n` : r.toString();
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
function nativeEvalInAnyRealm(enterPreview, context, closure) {
|
|
178
|
+
const realm = engine262_mjs.surroundingAgent.runningExecutionContext?.Realm || context.getAnyRealm()?.realm;
|
|
179
|
+
if (!realm) return undefined;
|
|
180
|
+
const exitPreview = enterPreview ? engine262_mjs.surroundingAgent.debugger_scopePreview() : undefined;
|
|
181
|
+
const pop = realm.pushTopContext();
|
|
182
|
+
let result = closure();
|
|
183
|
+
if (engine262_mjs.isEvaluator(result)) {
|
|
184
|
+
result = engine262_mjs.skipDebugger(result);
|
|
185
|
+
}
|
|
186
|
+
pop?.();
|
|
187
|
+
exitPreview?.[Symbol.dispose]();
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function unwrapFunction(value) {
|
|
192
|
+
if (engine262_mjs.isWrappedFunctionExoticObject(value)) {
|
|
193
|
+
return unwrapFunction(value.WrappedTargetFunction);
|
|
194
|
+
}
|
|
195
|
+
if (engine262_mjs.isBoundFunctionObject(value)) {
|
|
196
|
+
return unwrapFunction(value.BoundTargetFunction);
|
|
197
|
+
}
|
|
198
|
+
return value;
|
|
199
|
+
}
|
|
200
|
+
function toLocation(location, scriptId) {
|
|
201
|
+
return {
|
|
202
|
+
name: '[[FunctionLocation]]',
|
|
203
|
+
value: {
|
|
204
|
+
type: 'object',
|
|
205
|
+
subtype: 'internal#location',
|
|
206
|
+
description: 'Object',
|
|
207
|
+
value: {
|
|
208
|
+
columnNumber: location.start.column,
|
|
209
|
+
lineNumber: location.start.line - 1,
|
|
210
|
+
scriptId
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const Function = {
|
|
216
|
+
toRemoteObject(value, getObjectId) {
|
|
217
|
+
const result = {
|
|
218
|
+
type: 'function',
|
|
219
|
+
objectId: getObjectId(value)
|
|
220
|
+
};
|
|
221
|
+
value = unwrapFunction(value);
|
|
222
|
+
result.description = engine262_mjs.IntrinsicsFunctionToString(value);
|
|
223
|
+
if (engine262_mjs.isECMAScriptFunctionObject(value) && value.ECMAScriptCode) {
|
|
224
|
+
if (value.ECMAScriptCode.type === 'FunctionBody') {
|
|
225
|
+
result.className = 'Function';
|
|
226
|
+
} else if (value.ECMAScriptCode.type === 'GeneratorBody') {
|
|
227
|
+
result.className = 'GeneratorFunction';
|
|
228
|
+
} else if (value.ECMAScriptCode.type === 'AsyncBody') {
|
|
229
|
+
result.className = 'AsyncFunction';
|
|
230
|
+
} else if (value.ECMAScriptCode.type === 'AsyncGeneratorBody') {
|
|
231
|
+
result.className = 'AsyncGeneratorFunction';
|
|
232
|
+
}
|
|
233
|
+
} else {
|
|
234
|
+
result.className = 'Function';
|
|
235
|
+
}
|
|
236
|
+
return result;
|
|
237
|
+
},
|
|
238
|
+
toPropertyPreview: name => ({
|
|
239
|
+
name,
|
|
240
|
+
type: 'function',
|
|
241
|
+
value: ''
|
|
242
|
+
}),
|
|
243
|
+
toObjectPreview(value) {
|
|
244
|
+
return {
|
|
245
|
+
type: 'function',
|
|
246
|
+
description: engine262_mjs.IntrinsicsFunctionToString(unwrapFunction(value)),
|
|
247
|
+
overflow: false,
|
|
248
|
+
properties: []
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
toInternalProperties(value, getObjectId, context) {
|
|
252
|
+
const result = [];
|
|
253
|
+
while (true) {
|
|
254
|
+
if (engine262_mjs.isWrappedFunctionExoticObject(value)) {
|
|
255
|
+
if (!result.some(p => p.name === '[[WrappedTargetFunction]]')) {
|
|
256
|
+
result.push({
|
|
257
|
+
name: '[[WrappedTargetFunction]]',
|
|
258
|
+
value: context.toRemoteObject(value.WrappedTargetFunction, {
|
|
259
|
+
generatePreview: true
|
|
260
|
+
})
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
value = value.WrappedTargetFunction;
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
if (engine262_mjs.isBoundFunctionObject(value)) {
|
|
267
|
+
const v = value;
|
|
268
|
+
if (!result.some(p => p.name === '[[BoundTargetFunction]]')) {
|
|
269
|
+
result.push({
|
|
270
|
+
name: '[[BoundTargetFunction]]',
|
|
271
|
+
value: context.toRemoteObject(v.BoundTargetFunction, {
|
|
272
|
+
generatePreview: true
|
|
273
|
+
})
|
|
274
|
+
}, {
|
|
275
|
+
name: '[[BoundThis]]',
|
|
276
|
+
value: context.toRemoteObject(v.BoundThis, {
|
|
277
|
+
generatePreview: true
|
|
278
|
+
})
|
|
279
|
+
}, {
|
|
280
|
+
name: '[[BoundArguments]]',
|
|
281
|
+
value: context.toRemoteObject(engine262_mjs.X(nativeEvalInAnyRealm(false, context, () => engine262_mjs.CreateArrayFromList(v.BoundArguments))), {
|
|
282
|
+
generatePreview: true
|
|
283
|
+
})
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
value = v.BoundTargetFunction;
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
if (engine262_mjs.isECMAScriptFunctionObject(value)) {
|
|
292
|
+
if (!value.ECMAScriptCode) return [];
|
|
293
|
+
const scope = [];
|
|
294
|
+
let env = value.Environment;
|
|
295
|
+
while (env instanceof engine262_mjs.EnvironmentRecord) {
|
|
296
|
+
const result = getDisplayObjectFromEnvironmentRecord(env);
|
|
297
|
+
if (result) {
|
|
298
|
+
scope.push(result.object);
|
|
299
|
+
}
|
|
300
|
+
env = env.OuterEnv;
|
|
301
|
+
}
|
|
302
|
+
const scopeObject = engine262_mjs.X(nativeEvalInAnyRealm(false, context, () => engine262_mjs.CreateArrayFromList(scope)));
|
|
303
|
+
const scopeDesc = scopeObject ? {
|
|
304
|
+
className: 'Array',
|
|
305
|
+
description: `Scopes[${scope.length}]`,
|
|
306
|
+
objectId: getObjectId(scopeObject),
|
|
307
|
+
subtype: 'internal#scopeList',
|
|
308
|
+
type: 'object'
|
|
309
|
+
} : undefined;
|
|
310
|
+
result.push(toLocation(value.ECMAScriptCode.location, value.scriptId), {
|
|
311
|
+
name: '[[Scopes]]',
|
|
312
|
+
value: scopeDesc
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
if (engine262_mjs.isBuiltinFunctionObject(value)) {
|
|
316
|
+
if (value.HostLocation) {
|
|
317
|
+
const [scriptId, location] = value.HostLocation;
|
|
318
|
+
result.push(toLocation(location, scriptId));
|
|
319
|
+
}
|
|
320
|
+
if (value.nativeFunction.section) {
|
|
321
|
+
result.push({
|
|
322
|
+
name: '[[Section]]',
|
|
323
|
+
value: {
|
|
324
|
+
type: 'string',
|
|
325
|
+
value: value.nativeFunction.section
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return result;
|
|
331
|
+
},
|
|
332
|
+
toDescription: () => 'Function'
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
class ObjectInspector {
|
|
336
|
+
subtype;
|
|
337
|
+
className;
|
|
338
|
+
toDescription;
|
|
339
|
+
toCustomPreview;
|
|
340
|
+
toEntries;
|
|
341
|
+
additionalProperties;
|
|
342
|
+
internalProperties;
|
|
343
|
+
exoticProperties;
|
|
344
|
+
constructor(className, subtype, toDescription, additionalOptions) {
|
|
345
|
+
this.className = className;
|
|
346
|
+
this.subtype = subtype;
|
|
347
|
+
this.toDescription = toDescription;
|
|
348
|
+
this.toEntries = additionalOptions?.entries;
|
|
349
|
+
this.additionalProperties = additionalOptions?.additionalProperties;
|
|
350
|
+
this.internalProperties = additionalOptions?.internalProperties;
|
|
351
|
+
this.exoticProperties = additionalOptions?.exoticProperties;
|
|
352
|
+
this.toCustomPreview = additionalOptions?.customPreview;
|
|
353
|
+
}
|
|
354
|
+
toRemoteObject(value, getObjectId, context) {
|
|
355
|
+
const object = {
|
|
356
|
+
type: 'object',
|
|
357
|
+
subtype: this.subtype,
|
|
358
|
+
objectId: getObjectId(value),
|
|
359
|
+
className: typeof this.className === 'string' ? this.className : this.className(value),
|
|
360
|
+
description: this.toDescription(value, context),
|
|
361
|
+
preview: this.toObjectPreview(value, context)
|
|
362
|
+
};
|
|
363
|
+
const customPreview = this.toCustomPreview?.(value, getObjectId, context);
|
|
364
|
+
if (customPreview) object.customPreview = customPreview;
|
|
365
|
+
return object;
|
|
366
|
+
}
|
|
367
|
+
toPropertyPreview(name, value, context) {
|
|
368
|
+
return {
|
|
369
|
+
name,
|
|
370
|
+
type: 'object',
|
|
371
|
+
subtype: this.subtype,
|
|
372
|
+
value: this.toDescription(value, context)
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
toInternalProperties(value, getObjectId, context, generatePreview) {
|
|
376
|
+
const internalProperties = [...(this.internalProperties?.(value, context) || [])];
|
|
377
|
+
if (!internalProperties.length) {
|
|
378
|
+
return [];
|
|
379
|
+
}
|
|
380
|
+
return internalProperties.map(([name, val]) => {
|
|
381
|
+
let value;
|
|
382
|
+
if (val instanceof engine262_mjs.Value) {
|
|
383
|
+
value = getInspector(val).toRemoteObject(val, getObjectId, context, generatePreview);
|
|
384
|
+
} else {
|
|
385
|
+
const array = new engine262_mjs.ObjectValue([]);
|
|
386
|
+
array.DefineOwnProperty = engine262_mjs.ArrayExoticObjectInternalMethods.DefineOwnProperty;
|
|
387
|
+
array.properties.set('length', engine262_mjs.Descriptor({
|
|
388
|
+
Value: engine262_mjs.F(val.length)
|
|
389
|
+
}));
|
|
390
|
+
for (const [index, item] of val.entries()) {
|
|
391
|
+
let value;
|
|
392
|
+
if (item instanceof engine262_mjs.Value) {
|
|
393
|
+
value = item;
|
|
394
|
+
} else {
|
|
395
|
+
if (!item?.Key || !item.Value) {
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
value = new engine262_mjs.ObjectValue(['InspectorEntry']);
|
|
399
|
+
value.properties.set('key', engine262_mjs.Descriptor({
|
|
400
|
+
Value: item.Key
|
|
401
|
+
}));
|
|
402
|
+
value.properties.set('value', engine262_mjs.Descriptor({
|
|
403
|
+
Value: item.Value
|
|
404
|
+
}));
|
|
405
|
+
}
|
|
406
|
+
array.properties.set(engine262_mjs.Value(index.toString()), engine262_mjs.Descriptor({
|
|
407
|
+
Value: value
|
|
408
|
+
}));
|
|
409
|
+
}
|
|
410
|
+
value = getInspector(array).toRemoteObject(array, getObjectId, context, generatePreview);
|
|
411
|
+
}
|
|
412
|
+
return {
|
|
413
|
+
name,
|
|
414
|
+
value
|
|
415
|
+
};
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
toObjectPreview(value, context) {
|
|
419
|
+
const e = this.toEntries?.(value, context);
|
|
420
|
+
return {
|
|
421
|
+
type: 'object',
|
|
422
|
+
subtype: this.subtype,
|
|
423
|
+
description: this.toDescription(value, context),
|
|
424
|
+
entries: e?.length ? e : undefined,
|
|
425
|
+
...propertiesToPropertyPreview(value, [...(this.internalProperties?.(value, context) || []), ...(this.additionalProperties?.(value, context) || [])], context)
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
const DefaultObject = new ObjectInspector('Object', undefined, object => {
|
|
430
|
+
const [ctor] = object.ConstructedBy;
|
|
431
|
+
if (!ctor) {
|
|
432
|
+
return 'Object';
|
|
433
|
+
}
|
|
434
|
+
return propertyNameToString(ctor.HostInitialName);
|
|
435
|
+
});
|
|
436
|
+
const InternalInspectorEntry = new ObjectInspector('Object', 'internal#entry', (value, context) => {
|
|
437
|
+
const key = value.properties.get(engine262_mjs.Value('key')).Value;
|
|
438
|
+
const val = value.properties.get(engine262_mjs.Value('value')).Value;
|
|
439
|
+
return `{${getInspector(key).toDescription(key, context)} => ${getInspector(val).toDescription(val, context)}}`;
|
|
440
|
+
});
|
|
441
|
+
function propertyNameToString(value) {
|
|
442
|
+
if (value instanceof engine262_mjs.JSStringValue) {
|
|
443
|
+
return value.stringValue();
|
|
444
|
+
} else if (value instanceof engine262_mjs.PrivateName) {
|
|
445
|
+
return value.Description.stringValue();
|
|
446
|
+
} else {
|
|
447
|
+
return engine262_mjs.SymbolDescriptiveString(value).stringValue();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
function propertyToPropertyPreview(key, desc, context) {
|
|
451
|
+
const name = propertyNameToString(key);
|
|
452
|
+
if (desc.Getter || desc.Setter) {
|
|
453
|
+
return {
|
|
454
|
+
name,
|
|
455
|
+
type: 'accessor'
|
|
456
|
+
};
|
|
457
|
+
} else {
|
|
458
|
+
return getInspector(desc.Value).toPropertyPreview(name, desc.Value, context);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
function propertiesToPropertyPreview(value, extra, context, max = 5) {
|
|
462
|
+
let overflow = false;
|
|
463
|
+
const properties = [];
|
|
464
|
+
if (extra) {
|
|
465
|
+
for (const [key, value] of extra) {
|
|
466
|
+
if (value instanceof engine262_mjs.Value) {
|
|
467
|
+
properties.push(getInspector(value).toPropertyPreview(key, value, context));
|
|
468
|
+
}
|
|
469
|
+
// TODO:... handle Value[]
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (engine262_mjs.isTypedArrayObject(value) && value.ViewedArrayBuffer instanceof engine262_mjs.ObjectValue && value.ViewedArrayBuffer.ArrayBufferData instanceof engine262_mjs.DataBlock) {
|
|
473
|
+
const record = engine262_mjs.MakeTypedArrayWithBufferWitnessRecord(value, 'seq-cst');
|
|
474
|
+
const length = engine262_mjs.TypedArrayLength(record);
|
|
475
|
+
for (let index = 0; index < length; index += 1) {
|
|
476
|
+
const index_value = engine262_mjs.TypedArrayGetElement(value, engine262_mjs.Value(index));
|
|
477
|
+
if (index_value instanceof engine262_mjs.UndefinedValue) {
|
|
478
|
+
break;
|
|
479
|
+
}
|
|
480
|
+
if (properties.length > 100) {
|
|
481
|
+
overflow = true;
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
properties.push(getInspector(index_value).toPropertyPreview(index.toString(), index_value, context));
|
|
485
|
+
}
|
|
486
|
+
properties.push({
|
|
487
|
+
name: 'buffer',
|
|
488
|
+
type: 'object',
|
|
489
|
+
subtype: 'arraybuffer',
|
|
490
|
+
value: `ArrayBuffer(${value.ViewedArrayBuffer.ArrayBufferData.byteLength})`
|
|
491
|
+
}, {
|
|
492
|
+
name: 'byteLength',
|
|
493
|
+
type: 'number',
|
|
494
|
+
value: globalThis.String(value.ArrayLength)
|
|
495
|
+
}, {
|
|
496
|
+
name: 'byteOffset',
|
|
497
|
+
type: 'number',
|
|
498
|
+
value: globalThis.String(value.ByteOffset)
|
|
499
|
+
}, {
|
|
500
|
+
name: 'length',
|
|
501
|
+
type: 'number',
|
|
502
|
+
value: globalThis.String(length)
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
for (const [key, desc] of value.properties) {
|
|
506
|
+
if (properties.length > max) {
|
|
507
|
+
overflow = true;
|
|
508
|
+
break;
|
|
509
|
+
}
|
|
510
|
+
properties.push(propertyToPropertyPreview(key, desc, context));
|
|
511
|
+
}
|
|
512
|
+
for (const desc of value.PrivateElements) {
|
|
513
|
+
if (properties.length > max) {
|
|
514
|
+
overflow = true;
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
517
|
+
properties.push(propertyToPropertyPreview(desc.Key, desc, context));
|
|
518
|
+
}
|
|
519
|
+
return {
|
|
520
|
+
overflow,
|
|
521
|
+
properties
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
const ShadowRealm = new ObjectInspector('ShadowRealm', undefined, () => 'ShadowRealm', {
|
|
526
|
+
internalProperties: realm => [['[[GlobalObject]]', realm.ShadowRealm.GlobalObject]]
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
const Module = new ObjectInspector('Module', undefined, () => 'Module', {
|
|
530
|
+
additionalProperties: (module, context) => {
|
|
531
|
+
const result = [];
|
|
532
|
+
engine262_mjs.surroundingAgent.debugger_scopePreview(() => {
|
|
533
|
+
nativeEvalInAnyRealm(true, context, () => {
|
|
534
|
+
for (const key of module.Exports) {
|
|
535
|
+
const completion = engine262_mjs.EnsureCompletion(engine262_mjs.skipDebugger(engine262_mjs.Get(module, key)));
|
|
536
|
+
if (completion instanceof engine262_mjs.NormalCompletion) {
|
|
537
|
+
result.push([key.stringValue(), completion.Value]);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return engine262_mjs.Value.undefined;
|
|
541
|
+
});
|
|
542
|
+
});
|
|
543
|
+
return result;
|
|
544
|
+
},
|
|
545
|
+
exoticProperties(module, getObjectId, context, generatePreview) {
|
|
546
|
+
const result = [];
|
|
547
|
+
nativeEvalInAnyRealm(true, context, () => {
|
|
548
|
+
for (const key of module.Exports) {
|
|
549
|
+
const completion = engine262_mjs.EnsureCompletion(engine262_mjs.skipDebugger(engine262_mjs.Get(module, key)));
|
|
550
|
+
if (completion instanceof engine262_mjs.NormalCompletion) {
|
|
551
|
+
result.push({
|
|
552
|
+
name: key.stringValue(),
|
|
553
|
+
value: getInspector(completion.Value).toRemoteObject(completion.Value, getObjectId, context, generatePreview),
|
|
554
|
+
writable: false,
|
|
555
|
+
configurable: false,
|
|
556
|
+
enumerable: true,
|
|
557
|
+
isOwn: true
|
|
558
|
+
});
|
|
559
|
+
} else {
|
|
560
|
+
const realm = module.Module.Realm;
|
|
561
|
+
const evaluate = engine262_mjs.CreateBuiltinFunction(function* evaluate() {
|
|
562
|
+
return yield* engine262_mjs.Get(module, key);
|
|
563
|
+
}, 0, 'Module.evaluate', [], realm);
|
|
564
|
+
result.push({
|
|
565
|
+
name: key.stringValue(),
|
|
566
|
+
get: getInspector(evaluate).toRemoteObject(evaluate, getObjectId, context, generatePreview),
|
|
567
|
+
set: {
|
|
568
|
+
type: 'undefined'
|
|
569
|
+
},
|
|
570
|
+
writable: false,
|
|
571
|
+
configurable: false,
|
|
572
|
+
enumerable: true,
|
|
573
|
+
isOwn: true
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return engine262_mjs.Value.undefined;
|
|
578
|
+
});
|
|
579
|
+
return result;
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
const RegExp = new ObjectInspector('RegExp', 'regexp', value => `/${value.OriginalSource.stringValue()}/${value.OriginalFlags.stringValue()}`);
|
|
584
|
+
|
|
585
|
+
const Proxy$1 = new ObjectInspector('Proxy', 'proxy', value => {
|
|
586
|
+
if (engine262_mjs.IsCallable(value.ProxyTarget)) {
|
|
587
|
+
return 'Proxy(Function)';
|
|
588
|
+
}
|
|
589
|
+
if (value.ProxyTarget instanceof engine262_mjs.ObjectValue) {
|
|
590
|
+
return 'Proxy(Object)';
|
|
591
|
+
}
|
|
592
|
+
return 'Proxy';
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
const Promise$1 = new ObjectInspector('Promise', 'promise', () => 'Promise', {
|
|
596
|
+
internalProperties: value => [['[[PromiseState]]', engine262_mjs.Value(value.PromiseState)], ['[[PromiseResult]]', value.PromiseResult || engine262_mjs.Value.undefined]]
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
const Array$1 = {
|
|
600
|
+
toRemoteObject(value, getObjectId, context) {
|
|
601
|
+
return {
|
|
602
|
+
type: 'object',
|
|
603
|
+
className: 'Array',
|
|
604
|
+
subtype: 'array',
|
|
605
|
+
objectId: getObjectId(value),
|
|
606
|
+
description: getInspector(value).toDescription(value, context),
|
|
607
|
+
preview: this.toObjectPreview?.(value, context)
|
|
608
|
+
};
|
|
609
|
+
},
|
|
610
|
+
toPropertyPreview(name, value, context) {
|
|
611
|
+
return {
|
|
612
|
+
name,
|
|
613
|
+
type: 'object',
|
|
614
|
+
subtype: 'array',
|
|
615
|
+
value: this.toDescription(value, context)
|
|
616
|
+
};
|
|
617
|
+
},
|
|
618
|
+
toObjectPreview(value, context) {
|
|
619
|
+
const result = {
|
|
620
|
+
type: 'object',
|
|
621
|
+
subtype: 'array',
|
|
622
|
+
overflow: false,
|
|
623
|
+
properties: [],
|
|
624
|
+
description: this.toDescription(value, context)
|
|
625
|
+
};
|
|
626
|
+
const indexProp = [];
|
|
627
|
+
const otherProp = [];
|
|
628
|
+
for (const [key, desc] of value.properties) {
|
|
629
|
+
if (indexProp.length > 100) {
|
|
630
|
+
result.overflow = true;
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
if (engine262_mjs.isIntegerIndex(key)) {
|
|
634
|
+
indexProp.push(propertyToPropertyPreview(key, desc, context));
|
|
635
|
+
} else if (!(key instanceof engine262_mjs.JSStringValue && key.stringValue() === 'length')) {
|
|
636
|
+
otherProp.push(propertyToPropertyPreview(key, desc, context));
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
result.properties = indexProp.concat(otherProp).slice(0, 100);
|
|
640
|
+
return result;
|
|
641
|
+
},
|
|
642
|
+
toDescription(value) {
|
|
643
|
+
const length = [...value.properties.entries()].find(([key]) => key instanceof engine262_mjs.JSStringValue && key.stringValue() === 'length');
|
|
644
|
+
if (!length || !(length[1].Value instanceof engine262_mjs.NumberValue)) {
|
|
645
|
+
throw new TypeError('Bad ArrayExoticObject');
|
|
646
|
+
}
|
|
647
|
+
return `Array(${engine262_mjs.R(length[1].Value)})`;
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
const globalId = new WeakMap();
|
|
651
|
+
const id = new WeakMap();
|
|
652
|
+
const ArrayBuffer = new ObjectInspector('ArrayBuffer', 'arraybuffer', value => `ArrayBuffer(${value.ArrayBufferByteLength})`, {
|
|
653
|
+
internalProperties(value, context) {
|
|
654
|
+
if (value.ArrayBufferData instanceof engine262_mjs.DataBlock) {
|
|
655
|
+
if (!id.has(value.ArrayBufferData)) id.set(value.ArrayBufferData, (globalId.get(context) ?? 1000) + 1);
|
|
656
|
+
const blockId = id.get(value.ArrayBufferData);
|
|
657
|
+
globalId.set(context, blockId);
|
|
658
|
+
return [['[[ArrayBufferByteLength]]', engine262_mjs.Value(value.ArrayBufferByteLength)], ['[[ArrayBufferData]]', engine262_mjs.Value(blockId)]];
|
|
659
|
+
}
|
|
660
|
+
return [];
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
const DataView = new ObjectInspector('DataView', 'dataview', value => `DataView(${value.ByteLength})`);
|
|
664
|
+
const TypedArray = new ObjectInspector('TypedArray', 'typedarray', value => `${value.TypedArrayName.stringValue()}(${value.ArrayLength})`);
|
|
665
|
+
|
|
666
|
+
const Date$1 = new ObjectInspector('Date', 'date', value => {
|
|
667
|
+
if (!globalThis.Number.isFinite(value.DateValue)) {
|
|
668
|
+
return 'Invalid Date';
|
|
669
|
+
}
|
|
670
|
+
const val = engine262_mjs.DateProto_toISOString([], {
|
|
671
|
+
thisValue: value,
|
|
672
|
+
NewTarget: engine262_mjs.Value.undefined
|
|
673
|
+
});
|
|
674
|
+
return engine262_mjs.ValueOfNormalCompletion(val).stringValue();
|
|
675
|
+
});
|
|
676
|
+
const TemporalInstant = new ObjectInspector('Temporal.Instant', 'date', value => `Temporal.Instant <${engine262_mjs.TemporalInstantToString(value, undefined, 'auto')}>`);
|
|
677
|
+
const TemporalDuration = new ObjectInspector('Temporal.Duration', 'date', value => `Temporal.Duration <${engine262_mjs.TemporalDurationToString(value, 'auto')}>`);
|
|
678
|
+
const TemporalPlainDate = new ObjectInspector('Temporal.PlainDate', 'date', value => `Temporal.PlainDate <${engine262_mjs.TemporalDateToString(value, 'auto')}>`);
|
|
679
|
+
const TemporalPlainDateTime = new ObjectInspector('Temporal.PlainDateTime', 'date', value => `Temporal.PlainDateTime <${engine262_mjs.FormatISODateTime(value.ISODateTime, value.Calendar, 'auto', 'auto')}>`);
|
|
680
|
+
const TemporalPlainMonthDay = new ObjectInspector('Temporal.PlainMonthDay', 'date', value => `Temporal.PlainMonthDay <${engine262_mjs.TemporalMonthDayToString(value, 'auto')}>`);
|
|
681
|
+
const TemporalPlainTime = new ObjectInspector('Temporal.PlainTime', 'date', value => `Temporal.PlainTime <${engine262_mjs.TimeRecordToString(value.Time, 'auto')}>`);
|
|
682
|
+
const TemporalPlainYearMonth = new ObjectInspector('Temporal.PlainYearMonth', 'date', value => `Temporal.PlainYearMonth <${engine262_mjs.TemporalYearMonthToString(value, 'auto')}>`);
|
|
683
|
+
const TemporalZonedDateTime = new ObjectInspector('Temporal.ZonedDateTime', 'date', value => `Temporal.ZonedDateTime <${engine262_mjs.TemporalZonedDateTimeToString(value, 'auto', 'auto', 'auto', 'auto')}>`);
|
|
684
|
+
|
|
685
|
+
const Map$1 = new ObjectInspector('Map', 'map', value => `Map(${value.MapData.filter(x => !!x.Key).length})`, {
|
|
686
|
+
additionalProperties: value => [['size', engine262_mjs.Value(value.MapData.filter(x => !!x.Key).length)]],
|
|
687
|
+
internalProperties: value => [['[[Entries]]', value.MapData]],
|
|
688
|
+
entries: (value, context) => value.MapData.filter(x => x.Key).map(({
|
|
689
|
+
Key,
|
|
690
|
+
Value
|
|
691
|
+
}) => ({
|
|
692
|
+
key: getInspector(Key).toObjectPreview(Key, context),
|
|
693
|
+
value: getInspector(Value).toObjectPreview(Value, context)
|
|
694
|
+
}))
|
|
695
|
+
});
|
|
696
|
+
const Set$1 = new ObjectInspector('Set', 'set', value => `Set(${value.SetData.filter(globalThis.Boolean).length})`, {
|
|
697
|
+
additionalProperties: value => [['size', engine262_mjs.Value(value.SetData.filter(globalThis.Boolean).length)]],
|
|
698
|
+
internalProperties: value => [['[[Entries]]', value.SetData]],
|
|
699
|
+
entries: (value, context) => value.SetData.filter(globalThis.Boolean).map(Value => ({
|
|
700
|
+
value: getInspector(Value).toObjectPreview(Value, context)
|
|
701
|
+
}))
|
|
702
|
+
});
|
|
703
|
+
const WeakMap$1 = new ObjectInspector('WeakMap', 'weakmap', () => 'WeakMap', {
|
|
704
|
+
internalProperties: value => [['[[Entries]]', value.WeakMapData]],
|
|
705
|
+
entries: (value, context) => value.WeakMapData.filter(x => x.Key).map(({
|
|
706
|
+
Key,
|
|
707
|
+
Value
|
|
708
|
+
}) => ({
|
|
709
|
+
key: getInspector(Key).toObjectPreview(Key, context),
|
|
710
|
+
value: getInspector(Value).toObjectPreview(Value, context)
|
|
711
|
+
}))
|
|
712
|
+
});
|
|
713
|
+
const WeakSet = new ObjectInspector('WeakSet', 'weakset', () => 'WeakSet', {
|
|
714
|
+
internalProperties: value => [['[[Entries]]', value.WeakSetData]],
|
|
715
|
+
entries: (value, context) => value.WeakSetData.filter(globalThis.Boolean).map(Value => ({
|
|
716
|
+
value: getInspector(Value).toObjectPreview(Value, context)
|
|
717
|
+
}))
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
const Error$1 = new ObjectInspector('Error', 'error', (value, context) => {
|
|
721
|
+
let text = '';
|
|
722
|
+
nativeEvalInAnyRealm(true, context, () => {
|
|
723
|
+
const completion = engine262_mjs.EnsureCompletion(engine262_mjs.skipDebugger(engine262_mjs.Get(value, engine262_mjs.Value('stack'))));
|
|
724
|
+
if (completion instanceof engine262_mjs.NormalCompletion && completion.Value instanceof engine262_mjs.JSStringValue) {
|
|
725
|
+
text = completion.Value.stringValue();
|
|
726
|
+
if (!text.includes(' at') && !text.includes('SyntaxError')) {
|
|
727
|
+
text = '';
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
return engine262_mjs.Value.undefined;
|
|
731
|
+
});
|
|
732
|
+
return text || 'Error';
|
|
733
|
+
}, {
|
|
734
|
+
internalProperties: (error, context) => {
|
|
735
|
+
const unformattedMessage = engine262_mjs.getHostDefinedErrorDetails(error).message;
|
|
736
|
+
if (!unformattedMessage) return [];
|
|
737
|
+
const value = nativeEvalInAnyRealm(false, context, () => engine262_mjs.CreateArrayFromList(unformattedMessage.map(part => typeof part === 'string' ? engine262_mjs.Value(part) : part)));
|
|
738
|
+
if (!value) return [];
|
|
739
|
+
return [['[[UnformattedErrorMessage]]', engine262_mjs.X(value)]];
|
|
740
|
+
},
|
|
741
|
+
customPreview: (error, getObjectId, context) => {
|
|
742
|
+
const {
|
|
743
|
+
message,
|
|
744
|
+
stack,
|
|
745
|
+
stackGetterValue
|
|
746
|
+
} = engine262_mjs.getHostDefinedErrorDetails(error);
|
|
747
|
+
if (!message || !stackGetterValue) return undefined;
|
|
748
|
+
const stackC = engine262_mjs.EnsureCompletion(nativeEvalInAnyRealm(true, context, () => engine262_mjs.skipDebugger(engine262_mjs.Get(error, engine262_mjs.Value('stack')))));
|
|
749
|
+
if (stackC instanceof engine262_mjs.NormalCompletion && stackC.Value instanceof engine262_mjs.JSStringValue) {
|
|
750
|
+
const stackMaybeModified = stackC.Value.stringValue();
|
|
751
|
+
if (stackMaybeModified !== stackGetterValue) return undefined;
|
|
752
|
+
}
|
|
753
|
+
let constructorName = 'Error';
|
|
754
|
+
const nameC = engine262_mjs.EnsureCompletion(nativeEvalInAnyRealm(true, context, () => engine262_mjs.skipDebugger(engine262_mjs.Get(error, engine262_mjs.Value('name')))));
|
|
755
|
+
if (nameC instanceof engine262_mjs.NormalCompletion && nameC.Value instanceof engine262_mjs.JSStringValue) constructorName = nameC.Value.stringValue();
|
|
756
|
+
const header = JSON.stringify(['span', null, constructorName, ': ', ...message.map(part => typeof part === 'string' ? part : ['object', getInspector(part).toRemoteObject(part, getObjectId, context, false)]), stack]);
|
|
757
|
+
return {
|
|
758
|
+
header
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
function getInspector(value) {
|
|
764
|
+
switch (true) {
|
|
765
|
+
case value === engine262_mjs.Value.null:
|
|
766
|
+
return Null;
|
|
767
|
+
case value === engine262_mjs.Value.undefined:
|
|
768
|
+
return Undefined;
|
|
769
|
+
case value === engine262_mjs.Value.true || value === engine262_mjs.Value.false:
|
|
770
|
+
return Boolean$1;
|
|
771
|
+
case value instanceof engine262_mjs.SymbolValue:
|
|
772
|
+
return Symbol$1;
|
|
773
|
+
case value instanceof engine262_mjs.JSStringValue:
|
|
774
|
+
return String$1;
|
|
775
|
+
case value instanceof engine262_mjs.NumberValue:
|
|
776
|
+
case value instanceof engine262_mjs.BigIntValue:
|
|
777
|
+
return Number;
|
|
778
|
+
case engine262_mjs.isProxyExoticObject(value):
|
|
779
|
+
return Proxy$1;
|
|
780
|
+
case engine262_mjs.IsCallable(value):
|
|
781
|
+
return Function;
|
|
782
|
+
case engine262_mjs.isArrayExoticObject(value):
|
|
783
|
+
return Array$1;
|
|
784
|
+
case engine262_mjs.isRegExpObject(value):
|
|
785
|
+
return RegExp;
|
|
786
|
+
case engine262_mjs.isDateObject(value):
|
|
787
|
+
return Date$1;
|
|
788
|
+
case engine262_mjs.isMapObject(value):
|
|
789
|
+
return Map$1;
|
|
790
|
+
case engine262_mjs.isSetObject(value):
|
|
791
|
+
return Set$1;
|
|
792
|
+
case engine262_mjs.isWeakMapObject(value):
|
|
793
|
+
return WeakMap$1;
|
|
794
|
+
case engine262_mjs.isWeakSetObject(value):
|
|
795
|
+
return WeakSet;
|
|
796
|
+
// generator
|
|
797
|
+
case engine262_mjs.isErrorObject(value):
|
|
798
|
+
return Error$1;
|
|
799
|
+
case engine262_mjs.isPromiseObject(value):
|
|
800
|
+
return Promise$1;
|
|
801
|
+
case engine262_mjs.isTypedArrayObject(value):
|
|
802
|
+
return TypedArray;
|
|
803
|
+
case engine262_mjs.isArrayBufferObject(value):
|
|
804
|
+
return ArrayBuffer;
|
|
805
|
+
case engine262_mjs.isDataViewObject(value):
|
|
806
|
+
return DataView;
|
|
807
|
+
case engine262_mjs.isModuleNamespaceObject(value):
|
|
808
|
+
return Module;
|
|
809
|
+
case engine262_mjs.isShadowRealmObject(value):
|
|
810
|
+
return ShadowRealm;
|
|
811
|
+
case engine262_mjs.isTemporalInstantObject(value):
|
|
812
|
+
return TemporalInstant;
|
|
813
|
+
case engine262_mjs.isTemporalDurationObject(value):
|
|
814
|
+
return TemporalDuration;
|
|
815
|
+
case engine262_mjs.isTemporalPlainDateObject(value):
|
|
816
|
+
return TemporalPlainDate;
|
|
817
|
+
case engine262_mjs.isTemporalPlainDateTimeObject(value):
|
|
818
|
+
return TemporalPlainDateTime;
|
|
819
|
+
case engine262_mjs.isTemporalPlainMonthDayObject(value):
|
|
820
|
+
return TemporalPlainMonthDay;
|
|
821
|
+
case engine262_mjs.isTemporalPlainTimeObject(value):
|
|
822
|
+
return TemporalPlainTime;
|
|
823
|
+
case engine262_mjs.isTemporalPlainYearMonthObject(value):
|
|
824
|
+
return TemporalPlainYearMonth;
|
|
825
|
+
case engine262_mjs.isTemporalZonedDateTimeObject(value):
|
|
826
|
+
return TemporalZonedDateTime;
|
|
827
|
+
case value.internalSlotsList.includes('InspectorEntry'):
|
|
828
|
+
return InternalInspectorEntry;
|
|
829
|
+
default:
|
|
830
|
+
return DefaultObject;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
class InspectorContext {
|
|
835
|
+
#io;
|
|
836
|
+
constructor(io) {
|
|
837
|
+
this.#io = io;
|
|
838
|
+
}
|
|
839
|
+
realms = [];
|
|
840
|
+
attachRealm(realm, agent) {
|
|
841
|
+
const id = this.realms.length;
|
|
842
|
+
const descriptor = {
|
|
843
|
+
id,
|
|
844
|
+
origin: realm.HostDefined.specifier || 'vm://repl',
|
|
845
|
+
name: realm.HostDefined.name || 'engine262',
|
|
846
|
+
uniqueId: id.toString()
|
|
847
|
+
};
|
|
848
|
+
this.realms.push({
|
|
849
|
+
realm,
|
|
850
|
+
descriptor,
|
|
851
|
+
agent,
|
|
852
|
+
detach: () => {
|
|
853
|
+
realm.HostDefined.attachingInspector = oldInspector;
|
|
854
|
+
realm.HostDefined.attachingInspectorReportError = function attachingInspectorReportError(realm, error) {
|
|
855
|
+
if (this.attachingInspector && realm instanceof engine262_mjs.ManagedRealm) {
|
|
856
|
+
this.attachingInspector.console(realm, 'error', [error]);
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
const oldInspector = realm.HostDefined.attachingInspector;
|
|
862
|
+
realm.HostDefined.attachingInspector = this.#io;
|
|
863
|
+
this.#io.sendEvent['Runtime.executionContextCreated']({
|
|
864
|
+
context: descriptor
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
detachAgent(agent) {
|
|
868
|
+
for (const realm of this.realms) {
|
|
869
|
+
if (realm?.agent === agent) {
|
|
870
|
+
this.detachRealm(realm.realm);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
detachRealm(realm) {
|
|
875
|
+
const index = this.realms.findIndex(c => c?.realm === realm);
|
|
876
|
+
if (index === -1) {
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
879
|
+
const {
|
|
880
|
+
descriptor
|
|
881
|
+
} = this.realms[index];
|
|
882
|
+
realm.HostDefined.attachingInspector = undefined;
|
|
883
|
+
realm.HostDefined.attachingInspectorReportError = undefined;
|
|
884
|
+
this.realms[index] = undefined;
|
|
885
|
+
this.#io.sendEvent['Runtime.executionContextDestroyed']({
|
|
886
|
+
executionContextId: descriptor.id,
|
|
887
|
+
executionContextUniqueId: descriptor.uniqueId
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
getRealm(realm) {
|
|
891
|
+
if (realm === undefined) {
|
|
892
|
+
if (engine262_mjs.surroundingAgent.runningExecutionContext && engine262_mjs.surroundingAgent.currentRealmRecord instanceof engine262_mjs.ManagedRealm) {
|
|
893
|
+
realm = engine262_mjs.surroundingAgent.currentRealmRecord;
|
|
894
|
+
} else {
|
|
895
|
+
return undefined;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
if (typeof realm === 'string') {
|
|
899
|
+
return this.realms.find(c => c?.descriptor.uniqueId === realm);
|
|
900
|
+
} else if (typeof realm === 'number') {
|
|
901
|
+
return this.realms[realm];
|
|
902
|
+
}
|
|
903
|
+
return this.realms.find(c => c?.realm === realm);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/** @deprecated in this case we are guessing the realm should be using, which may create bad result */
|
|
907
|
+
getAnyRealm() {
|
|
908
|
+
return this.realms.find(Boolean);
|
|
909
|
+
}
|
|
910
|
+
#idToObject = new Map();
|
|
911
|
+
#objectToId = new Map();
|
|
912
|
+
#objectCounter = 1;
|
|
913
|
+
#internObject(object, group = 'default') {
|
|
914
|
+
if (this.#objectToId.has(object)) {
|
|
915
|
+
return this.#objectToId.get(object);
|
|
916
|
+
}
|
|
917
|
+
const id = `${group}:${this.#objectCounter}`;
|
|
918
|
+
this.#objectCounter += 1;
|
|
919
|
+
this.#idToObject.set(id, object);
|
|
920
|
+
this.#objectToId.set(object, id);
|
|
921
|
+
return id;
|
|
922
|
+
}
|
|
923
|
+
releaseObject(id) {
|
|
924
|
+
const object = this.#idToObject.get(id);
|
|
925
|
+
if (object) {
|
|
926
|
+
this.#idToObject.delete(id);
|
|
927
|
+
this.#objectToId.delete(object);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
releaseObjectGroup(group) {
|
|
931
|
+
for (const [id, object] of this.#idToObject.entries()) {
|
|
932
|
+
if (id.startsWith(group)) {
|
|
933
|
+
this.#idToObject.delete(id);
|
|
934
|
+
this.#objectToId.delete(object);
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
getObject(objectId) {
|
|
939
|
+
return this.#idToObject.get(objectId);
|
|
940
|
+
}
|
|
941
|
+
toRemoteObject(value, options) {
|
|
942
|
+
return getInspector(value).toRemoteObject(value, val => this.#internObject(val, options.objectGroup), this, options.generatePreview);
|
|
943
|
+
}
|
|
944
|
+
getProperties({
|
|
945
|
+
objectId,
|
|
946
|
+
accessorPropertiesOnly,
|
|
947
|
+
generatePreview,
|
|
948
|
+
nonIndexedPropertiesOnly,
|
|
949
|
+
ownProperties
|
|
950
|
+
}) {
|
|
951
|
+
const object = this.getObject(objectId);
|
|
952
|
+
if (!(object instanceof engine262_mjs.ObjectValue)) {
|
|
953
|
+
return {
|
|
954
|
+
result: []
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
const wrap = v => this.toRemoteObject(v, {
|
|
958
|
+
generatePreview
|
|
959
|
+
});
|
|
960
|
+
const properties = [];
|
|
961
|
+
const internalProperties = [];
|
|
962
|
+
const privateProperties = [];
|
|
963
|
+
if (!accessorPropertiesOnly) {
|
|
964
|
+
object.PrivateElements.forEach(value => {
|
|
965
|
+
const desc = {
|
|
966
|
+
name: value.Key.Description.stringValue()
|
|
967
|
+
};
|
|
968
|
+
if (value.Value) desc.value = wrap(value.Value);
|
|
969
|
+
if (value.Getter) desc.get = wrap(value.Getter);
|
|
970
|
+
if (value.Setter) desc.set = wrap(value.Setter);
|
|
971
|
+
privateProperties.push(desc);
|
|
972
|
+
});
|
|
973
|
+
const exoticProperties = getInspector(object).exoticProperties?.(object, val => this.#internObject(val), this, generatePreview);
|
|
974
|
+
if (exoticProperties) {
|
|
975
|
+
properties.push(...exoticProperties);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
(() => {
|
|
979
|
+
let p = object;
|
|
980
|
+
while (p instanceof engine262_mjs.ObjectValue) {
|
|
981
|
+
for (const key of p.properties.keys()) {
|
|
982
|
+
if (nonIndexedPropertiesOnly && engine262_mjs.isIntegerIndex(key)) {
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
const desc = p.properties.get(key);
|
|
986
|
+
if (!desc) {
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
if (accessorPropertiesOnly && !engine262_mjs.IsAccessorDescriptor(desc)) {
|
|
990
|
+
continue;
|
|
991
|
+
}
|
|
992
|
+
const descriptor = {
|
|
993
|
+
name: key instanceof engine262_mjs.JSStringValue ? key.stringValue() : engine262_mjs.SymbolDescriptiveString(key).stringValue(),
|
|
994
|
+
writable: desc.Writable === engine262_mjs.Value.true,
|
|
995
|
+
configurable: desc.Configurable === engine262_mjs.Value.true,
|
|
996
|
+
enumerable: desc.Enumerable === engine262_mjs.Value.true,
|
|
997
|
+
isOwn: p === object
|
|
998
|
+
};
|
|
999
|
+
if (desc.Value && !('HostUninitializedBindingMarkerObject' in desc.Value)) descriptor.value = wrap(desc.Value);
|
|
1000
|
+
if (desc.Getter) descriptor.get = wrap(desc.Getter);
|
|
1001
|
+
if (desc.Setter) descriptor.set = wrap(desc.Setter);
|
|
1002
|
+
if (key instanceof engine262_mjs.SymbolValue) descriptor.symbol = wrap(key);
|
|
1003
|
+
properties.push(descriptor);
|
|
1004
|
+
}
|
|
1005
|
+
if (ownProperties) {
|
|
1006
|
+
break;
|
|
1007
|
+
}
|
|
1008
|
+
if ('Prototype' in p) {
|
|
1009
|
+
p = p.Prototype;
|
|
1010
|
+
} else {
|
|
1011
|
+
p = engine262_mjs.Value.null;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
})();
|
|
1015
|
+
const additionalInternalFields = getInspector(object).toInternalProperties?.(object, val => this.#internObject(val, 'default'), this, generatePreview);
|
|
1016
|
+
if (additionalInternalFields) {
|
|
1017
|
+
internalProperties.push(...additionalInternalFields);
|
|
1018
|
+
}
|
|
1019
|
+
if ('Prototype' in object) {
|
|
1020
|
+
internalProperties.push({
|
|
1021
|
+
name: '[[Prototype]]',
|
|
1022
|
+
value: wrap(object.Prototype)
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
return {
|
|
1026
|
+
result: properties,
|
|
1027
|
+
internalProperties,
|
|
1028
|
+
privateProperties
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
createExceptionDetails(completion, isPromise) {
|
|
1032
|
+
const value = completion instanceof engine262_mjs.ThrowCompletion ? completion.Value : completion;
|
|
1033
|
+
const {
|
|
1034
|
+
callStack
|
|
1035
|
+
} = engine262_mjs.getHostDefinedErrorDetails(value);
|
|
1036
|
+
const frames = InspectorContext.callSiteToCallFrame(callStack);
|
|
1037
|
+
const exceptionId = this.#objectCounter;
|
|
1038
|
+
this.#objectCounter += 1;
|
|
1039
|
+
return {
|
|
1040
|
+
text: isPromise ? 'Uncaught (in promise)' : 'Uncaught',
|
|
1041
|
+
stackTrace: callStack ? {
|
|
1042
|
+
callFrames: frames
|
|
1043
|
+
} : undefined,
|
|
1044
|
+
exception: getInspector(value).toRemoteObject(value, val => this.#internObject(val), this, false),
|
|
1045
|
+
lineNumber: frames[0]?.lineNumber || 0,
|
|
1046
|
+
columnNumber: frames[0]?.columnNumber || 0,
|
|
1047
|
+
exceptionId,
|
|
1048
|
+
scriptId: frames[0]?.scriptId,
|
|
1049
|
+
url: frames[0]?.url
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
static callSiteToCallFrame(callSite) {
|
|
1053
|
+
return callSite?.map(call => call.toCallFrame()).filter(Boolean) || [];
|
|
1054
|
+
}
|
|
1055
|
+
createEvaluationResult(completion) {
|
|
1056
|
+
completion = engine262_mjs.EnsureCompletion(completion);
|
|
1057
|
+
if (!(completion.Value instanceof engine262_mjs.Value)) {
|
|
1058
|
+
throw new RangeError('Invalid completion value');
|
|
1059
|
+
}
|
|
1060
|
+
return {
|
|
1061
|
+
exceptionDetails: completion instanceof engine262_mjs.ThrowCompletion ? this.createExceptionDetails(completion, false) : undefined,
|
|
1062
|
+
result: this.toRemoteObject(completion.Value, {})
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
getDebuggerCallFrame() {
|
|
1066
|
+
const stacks = engine262_mjs.getCurrentStack(false);
|
|
1067
|
+
const length = engine262_mjs.surroundingAgent.executionContextStack.length;
|
|
1068
|
+
return stacks.map((stack, index) => {
|
|
1069
|
+
if (!stack.getScriptId()) {
|
|
1070
|
+
return undefined;
|
|
1071
|
+
}
|
|
1072
|
+
const scopeChain = [];
|
|
1073
|
+
let env = stack.context.LexicalEnvironment;
|
|
1074
|
+
while (env instanceof engine262_mjs.EnvironmentRecord) {
|
|
1075
|
+
const result = getDisplayObjectFromEnvironmentRecord(env);
|
|
1076
|
+
if (result) {
|
|
1077
|
+
scopeChain.push({
|
|
1078
|
+
type: result.type,
|
|
1079
|
+
object: this.toRemoteObject(result.object, {})
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
env = env.OuterEnv;
|
|
1083
|
+
}
|
|
1084
|
+
return {
|
|
1085
|
+
callFrameId: String(length - index - 1),
|
|
1086
|
+
functionName: stack.getFunctionName() || '<anonymous>',
|
|
1087
|
+
location: {
|
|
1088
|
+
scriptId: stack.getScriptId(),
|
|
1089
|
+
lineNumber: (stack.lineNumber || 1) - 1,
|
|
1090
|
+
columnNumber: (stack.columnNumber || 1) - 1
|
|
1091
|
+
},
|
|
1092
|
+
this: this.toRemoteObject(HostGetThisEnvironment(stack.context.LexicalEnvironment), {}),
|
|
1093
|
+
url: stack.getSpecifier() || '',
|
|
1094
|
+
canBeRestarted: false,
|
|
1095
|
+
functionLocation: engine262_mjs.isECMAScriptFunctionObject(stack.context.Function) ? {
|
|
1096
|
+
lineNumber: (stack.context.Function.ECMAScriptCode?.location.start.line || 1) - 1,
|
|
1097
|
+
columnNumber: (stack.context.Function.ECMAScriptCode?.location.start.column || 1) - 1,
|
|
1098
|
+
scriptId: stack.getScriptId() || ''
|
|
1099
|
+
} : undefined,
|
|
1100
|
+
scopeChain
|
|
1101
|
+
};
|
|
1102
|
+
}).filter(Boolean);
|
|
1103
|
+
}
|
|
1104
|
+
evaluateMode = 'script';
|
|
1105
|
+
}
|
|
1106
|
+
function HostGetThisEnvironment(env) {
|
|
1107
|
+
while (env !== null) {
|
|
1108
|
+
const exists = env.HasThisBinding();
|
|
1109
|
+
if (exists === engine262_mjs.Value.true) {
|
|
1110
|
+
const value = env.GetThisBinding();
|
|
1111
|
+
if (value instanceof engine262_mjs.ThrowCompletion) {
|
|
1112
|
+
return engine262_mjs.Value.undefined;
|
|
1113
|
+
}
|
|
1114
|
+
return value;
|
|
1115
|
+
}
|
|
1116
|
+
const outer = env.OuterEnv;
|
|
1117
|
+
env = outer;
|
|
1118
|
+
}
|
|
1119
|
+
throw new ReferenceError('No this environment found');
|
|
1120
|
+
}
|
|
1121
|
+
function getDisplayObjectFromEnvironmentRecord(record) {
|
|
1122
|
+
if (record instanceof engine262_mjs.DeclarativeEnvironmentRecord) {
|
|
1123
|
+
const object = engine262_mjs.OrdinaryObjectCreate(engine262_mjs.Value.null, ['HostInspectorScopePreview']);
|
|
1124
|
+
for (const [key, binding] of record.bindings) {
|
|
1125
|
+
const value = binding.initialized ? binding.value : engine262_mjs.OrdinaryObjectCreate(engine262_mjs.Value.null, ['HostUninitializedBindingMarkerObject']);
|
|
1126
|
+
if (engine262_mjs.isArgumentExoticObject(value)) {
|
|
1127
|
+
continue;
|
|
1128
|
+
}
|
|
1129
|
+
object.properties.set(key, engine262_mjs.Descriptor({
|
|
1130
|
+
Enumerable: engine262_mjs.isArgumentExoticObject(value) ? engine262_mjs.Value.false : engine262_mjs.Value.true,
|
|
1131
|
+
Value: value,
|
|
1132
|
+
Writable: binding.mutable ? engine262_mjs.Value.true : engine262_mjs.Value.false
|
|
1133
|
+
}));
|
|
1134
|
+
}
|
|
1135
|
+
let type = 'block';
|
|
1136
|
+
if (record instanceof engine262_mjs.FunctionEnvironmentRecord) {
|
|
1137
|
+
type = 'local';
|
|
1138
|
+
} else if (record instanceof engine262_mjs.ModuleEnvironmentRecord) {
|
|
1139
|
+
type = 'module';
|
|
1140
|
+
}
|
|
1141
|
+
if (type !== 'local' && !object.properties.size) {
|
|
1142
|
+
return undefined;
|
|
1143
|
+
}
|
|
1144
|
+
return {
|
|
1145
|
+
type,
|
|
1146
|
+
object
|
|
1147
|
+
};
|
|
1148
|
+
} else if (record instanceof engine262_mjs.ObjectEnvironmentRecord) {
|
|
1149
|
+
return {
|
|
1150
|
+
type: record.IsWithEnvironment === engine262_mjs.Value.true ? 'with' : 'global',
|
|
1151
|
+
object: record.BindingObject
|
|
1152
|
+
};
|
|
1153
|
+
} else if (record instanceof engine262_mjs.GlobalEnvironmentRecord) {
|
|
1154
|
+
return {
|
|
1155
|
+
type: 'global',
|
|
1156
|
+
object: record.GlobalThisValue
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
throw new TypeError('Unknown environment record');
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
function getParsedEvent(source, id, executionContextId) {
|
|
1163
|
+
const lines = source.ECMAScriptCode.sourceText.split('\n');
|
|
1164
|
+
return {
|
|
1165
|
+
isModule: source instanceof engine262_mjs.SourceTextModuleRecord,
|
|
1166
|
+
scriptId: id,
|
|
1167
|
+
url: source.HostDefined?.specifier || `vm:///${id}`,
|
|
1168
|
+
startLine: 0,
|
|
1169
|
+
startColumn: 0,
|
|
1170
|
+
endLine: lines.length,
|
|
1171
|
+
endColumn: lines.pop().length,
|
|
1172
|
+
executionContextId,
|
|
1173
|
+
hash: '',
|
|
1174
|
+
buildId: ''
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
const Debugger = {
|
|
1179
|
+
enable(_req, context) {
|
|
1180
|
+
context.onDebuggerConnect();
|
|
1181
|
+
return {
|
|
1182
|
+
debuggerId: 'debugger.0'
|
|
1183
|
+
};
|
|
1184
|
+
},
|
|
1185
|
+
disable(_req, context) {
|
|
1186
|
+
context.onDebuggerDisconnect();
|
|
1187
|
+
},
|
|
1188
|
+
getScriptSource({
|
|
1189
|
+
scriptId
|
|
1190
|
+
}) {
|
|
1191
|
+
const source = engine262_mjs.surroundingAgent.parsedSources.get(scriptId);
|
|
1192
|
+
if (!source) {
|
|
1193
|
+
throw new Error('Not found');
|
|
1194
|
+
}
|
|
1195
|
+
return {
|
|
1196
|
+
scriptSource: source.ECMAScriptCode.sourceText
|
|
1197
|
+
};
|
|
1198
|
+
},
|
|
1199
|
+
setAsyncCallStackDepth() {},
|
|
1200
|
+
setBlackboxPatterns() {},
|
|
1201
|
+
setBlackboxExecutionContexts() {},
|
|
1202
|
+
// #region breakpoints
|
|
1203
|
+
getPossibleBreakpoints({
|
|
1204
|
+
start,
|
|
1205
|
+
end,
|
|
1206
|
+
restrictToFunction
|
|
1207
|
+
}) {
|
|
1208
|
+
return {
|
|
1209
|
+
locations: [...engine262_mjs.getBreakpointCandidateNodes(start, end, restrictToFunction)].map(node => engine262_mjs.parseNodeToBreakpointLocation(start.scriptId, node))
|
|
1210
|
+
};
|
|
1211
|
+
},
|
|
1212
|
+
removeBreakpoint({
|
|
1213
|
+
breakpointId
|
|
1214
|
+
}) {
|
|
1215
|
+
engine262_mjs.surroundingAgent?.removeBreakpoint(breakpointId);
|
|
1216
|
+
},
|
|
1217
|
+
setBreakpoint(req) {
|
|
1218
|
+
return engine262_mjs.surroundingAgent.addBreakpointByLocation(req);
|
|
1219
|
+
},
|
|
1220
|
+
setBreakpointByUrl(req) {
|
|
1221
|
+
return engine262_mjs.surroundingAgent.addBreakpointByUrl(req);
|
|
1222
|
+
},
|
|
1223
|
+
setBreakpointOnFunctionCall(req, context) {
|
|
1224
|
+
const f = context.context.getObject(req.objectId);
|
|
1225
|
+
if (!f || !engine262_mjs.isFunctionObject(f)) return {
|
|
1226
|
+
breakpointId: null
|
|
1227
|
+
};
|
|
1228
|
+
return engine262_mjs.surroundingAgent.addBreakpointOnFunctionCall(f, req.condition);
|
|
1229
|
+
},
|
|
1230
|
+
setInstrumentationBreakpoint(req) {
|
|
1231
|
+
return engine262_mjs.surroundingAgent.addInstrumentationBreakpoint(req);
|
|
1232
|
+
},
|
|
1233
|
+
setBreakpointsActive({
|
|
1234
|
+
active
|
|
1235
|
+
}) {
|
|
1236
|
+
engine262_mjs.surroundingAgent.breakpointsEnabled = active;
|
|
1237
|
+
},
|
|
1238
|
+
setPauseOnExceptions({
|
|
1239
|
+
state
|
|
1240
|
+
}) {
|
|
1241
|
+
if (engine262_mjs.surroundingAgent) {
|
|
1242
|
+
engine262_mjs.surroundingAgent.pauseOnExceptions = state === 'none' ? undefined : state;
|
|
1243
|
+
}
|
|
1244
|
+
},
|
|
1245
|
+
// #endregion
|
|
1246
|
+
|
|
1247
|
+
stepInto(_, {
|
|
1248
|
+
sendEvent
|
|
1249
|
+
}) {
|
|
1250
|
+
sendEvent['Debugger.resumed']();
|
|
1251
|
+
engine262_mjs.surroundingAgent.resumeEvaluate({
|
|
1252
|
+
pauseAt: 'step-in'
|
|
1253
|
+
});
|
|
1254
|
+
},
|
|
1255
|
+
resume(_, {
|
|
1256
|
+
sendEvent
|
|
1257
|
+
}) {
|
|
1258
|
+
sendEvent['Debugger.resumed']();
|
|
1259
|
+
engine262_mjs.surroundingAgent.resumeEvaluate();
|
|
1260
|
+
},
|
|
1261
|
+
stepOver(_req, {
|
|
1262
|
+
sendEvent
|
|
1263
|
+
}) {
|
|
1264
|
+
sendEvent['Debugger.resumed']();
|
|
1265
|
+
engine262_mjs.surroundingAgent.resumeEvaluate({
|
|
1266
|
+
pauseAt: 'step-over'
|
|
1267
|
+
});
|
|
1268
|
+
},
|
|
1269
|
+
stepOut(_req, {
|
|
1270
|
+
sendEvent
|
|
1271
|
+
}) {
|
|
1272
|
+
sendEvent['Debugger.resumed']();
|
|
1273
|
+
engine262_mjs.surroundingAgent.resumeEvaluate({
|
|
1274
|
+
pauseAt: 'step-out'
|
|
1275
|
+
});
|
|
1276
|
+
},
|
|
1277
|
+
evaluateOnCallFrame(req, context) {
|
|
1278
|
+
return evaluate({
|
|
1279
|
+
...req,
|
|
1280
|
+
uniqueContextId: context.context.getRealm(undefined).descriptor.uniqueId,
|
|
1281
|
+
evalMode: context.context.evaluateMode
|
|
1282
|
+
}, context);
|
|
1283
|
+
},
|
|
1284
|
+
engine262_setEvaluateMode({
|
|
1285
|
+
mode
|
|
1286
|
+
}, {
|
|
1287
|
+
context
|
|
1288
|
+
}) {
|
|
1289
|
+
if (mode === 'module' || mode === 'script' || mode === 'console') {
|
|
1290
|
+
context.evaluateMode = mode;
|
|
1291
|
+
}
|
|
1292
|
+
},
|
|
1293
|
+
engine262_setFeatures() {
|
|
1294
|
+
throw new Error('Method should not be implemented here.');
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
const Profiler = {
|
|
1298
|
+
enable() {}
|
|
1299
|
+
};
|
|
1300
|
+
const Runtime = {
|
|
1301
|
+
discardConsoleEntries() {},
|
|
1302
|
+
enable() {},
|
|
1303
|
+
compileScript(options, {
|
|
1304
|
+
context,
|
|
1305
|
+
sendEvent
|
|
1306
|
+
}) {
|
|
1307
|
+
let parsed;
|
|
1308
|
+
let realm = context.getRealm(options.executionContextId);
|
|
1309
|
+
if (!realm && !options.persistScript) {
|
|
1310
|
+
realm = context.getAnyRealm();
|
|
1311
|
+
}
|
|
1312
|
+
if (!realm) {
|
|
1313
|
+
return unsupportedError;
|
|
1314
|
+
}
|
|
1315
|
+
const pop = realm.realm.pushTopContext();
|
|
1316
|
+
if (context.evaluateMode === 'module') {
|
|
1317
|
+
parsed = engine262_mjs.ParseModule(options.expression, realm.realm, {
|
|
1318
|
+
specifier: options.sourceURL,
|
|
1319
|
+
doNotTrackScriptId: !options.persistScript
|
|
1320
|
+
});
|
|
1321
|
+
} else {
|
|
1322
|
+
parsed = engine262_mjs.ParseScript(options.expression, realm.realm, {
|
|
1323
|
+
specifier: options.sourceURL,
|
|
1324
|
+
doNotTrackScriptId: !options.persistScript,
|
|
1325
|
+
[engine262_mjs.kInternal]: {
|
|
1326
|
+
allowAllPrivateNames: true,
|
|
1327
|
+
allowAwait: true
|
|
1328
|
+
}
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
pop?.();
|
|
1332
|
+
if (!parsed) {
|
|
1333
|
+
throw new Error('No parsed result');
|
|
1334
|
+
}
|
|
1335
|
+
if (Array.isArray(parsed)) {
|
|
1336
|
+
const e = context.createExceptionDetails(engine262_mjs.ThrowCompletion(parsed[0]), false);
|
|
1337
|
+
// Note: it has to be this message to trigger devtools' line wrap.
|
|
1338
|
+
e.exception.description = 'SyntaxError: Unexpected end of input';
|
|
1339
|
+
return {
|
|
1340
|
+
exceptionDetails: e
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
if (options.persistScript) {
|
|
1344
|
+
if (realm?.descriptor.id === undefined) {
|
|
1345
|
+
throw new Error('No realm id found');
|
|
1346
|
+
}
|
|
1347
|
+
const event = getParsedEvent(parsed, parsed.HostDefined.scriptId, realm.descriptor.id);
|
|
1348
|
+
sendEvent['Debugger.scriptParsed'](event);
|
|
1349
|
+
return {
|
|
1350
|
+
scriptId: event.scriptId
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
return {};
|
|
1354
|
+
},
|
|
1355
|
+
callFunctionOn(options, {
|
|
1356
|
+
context
|
|
1357
|
+
}) {
|
|
1358
|
+
const realmDesc = context.getRealm(options.uniqueContextId || options.executionContextId) || context.getAnyRealm();
|
|
1359
|
+
if (!realmDesc) {
|
|
1360
|
+
throw new Error('No realm found');
|
|
1361
|
+
}
|
|
1362
|
+
const {
|
|
1363
|
+
Value: F
|
|
1364
|
+
} = realmDesc.realm.evaluateScriptSkipDebugger(`(${options.functionDeclaration})`, {
|
|
1365
|
+
doNotTrackScriptId: true
|
|
1366
|
+
});
|
|
1367
|
+
const thisValue = options.objectId ? context.getObject(options.objectId) : engine262_mjs.Value.undefined;
|
|
1368
|
+
const args = options.arguments?.map(a => {
|
|
1369
|
+
// TODO: revisit
|
|
1370
|
+
if ('value' in a) {
|
|
1371
|
+
return engine262_mjs.Value(a.value);
|
|
1372
|
+
}
|
|
1373
|
+
if (a.objectId) {
|
|
1374
|
+
return context.getObject(a.objectId);
|
|
1375
|
+
}
|
|
1376
|
+
if ('unserializableValue' in a) {
|
|
1377
|
+
throw new RangeError();
|
|
1378
|
+
}
|
|
1379
|
+
return engine262_mjs.Value.undefined;
|
|
1380
|
+
});
|
|
1381
|
+
const pop = realmDesc.realm.pushTopContext();
|
|
1382
|
+
const completion = engine262_mjs.evalQ(Q => {
|
|
1383
|
+
const r = Q(engine262_mjs.skipDebugger(engine262_mjs.Call(F, thisValue, args || [])));
|
|
1384
|
+
if (options.returnByValue) {
|
|
1385
|
+
const value = engine262_mjs.X(engine262_mjs.Call(realmDesc.realm.Intrinsics['%JSON.stringify%'], engine262_mjs.Value.undefined, [r]));
|
|
1386
|
+
if (value instanceof engine262_mjs.JSStringValue) {
|
|
1387
|
+
const valueRealized = JSON.parse(value.stringValue());
|
|
1388
|
+
return {
|
|
1389
|
+
result: {
|
|
1390
|
+
type: typeof value,
|
|
1391
|
+
value: valueRealized
|
|
1392
|
+
}
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
return context.createEvaluationResult(r);
|
|
1397
|
+
});
|
|
1398
|
+
pop?.();
|
|
1399
|
+
if (completion instanceof engine262_mjs.ThrowCompletion) {
|
|
1400
|
+
return {
|
|
1401
|
+
result: {
|
|
1402
|
+
type: 'undefined'
|
|
1403
|
+
},
|
|
1404
|
+
exceptionDetails: context.createExceptionDetails(completion, false)
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
return completion.Value;
|
|
1408
|
+
},
|
|
1409
|
+
evaluate(options, context) {
|
|
1410
|
+
return evaluate({
|
|
1411
|
+
...options,
|
|
1412
|
+
evalMode: context.context.evaluateMode,
|
|
1413
|
+
uniqueContextId: options.uniqueContextId
|
|
1414
|
+
}, context);
|
|
1415
|
+
},
|
|
1416
|
+
getExceptionDetails(req, {
|
|
1417
|
+
context
|
|
1418
|
+
}) {
|
|
1419
|
+
const object = context.getObject(req.errorObjectId);
|
|
1420
|
+
if (object instanceof engine262_mjs.ObjectValue) {
|
|
1421
|
+
return {
|
|
1422
|
+
exceptionDetails: context.createExceptionDetails(engine262_mjs.ThrowCompletion(object), false)
|
|
1423
|
+
};
|
|
1424
|
+
}
|
|
1425
|
+
return {
|
|
1426
|
+
exceptionDetails: {
|
|
1427
|
+
text: 'unsupported',
|
|
1428
|
+
lineNumber: 0,
|
|
1429
|
+
columnNumber: 0,
|
|
1430
|
+
exceptionId: 0
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
},
|
|
1434
|
+
getHeapUsage() {
|
|
1435
|
+
return {
|
|
1436
|
+
usedSize: 0,
|
|
1437
|
+
totalSize: 0,
|
|
1438
|
+
backingStorageSize: 0,
|
|
1439
|
+
embedderHeapUsedSize: 0
|
|
1440
|
+
};
|
|
1441
|
+
},
|
|
1442
|
+
getIsolateId() {
|
|
1443
|
+
return {
|
|
1444
|
+
id: 'isolate.0'
|
|
1445
|
+
};
|
|
1446
|
+
},
|
|
1447
|
+
getProperties(options, {
|
|
1448
|
+
context
|
|
1449
|
+
}) {
|
|
1450
|
+
return context.getProperties(options);
|
|
1451
|
+
},
|
|
1452
|
+
globalLexicalScopeNames({
|
|
1453
|
+
executionContextId
|
|
1454
|
+
}, {
|
|
1455
|
+
context
|
|
1456
|
+
}) {
|
|
1457
|
+
const global = context.getRealm(executionContextId)?.realm.GlobalObject;
|
|
1458
|
+
if (!global) {
|
|
1459
|
+
return {
|
|
1460
|
+
names: []
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
const keys = engine262_mjs.skipDebugger(global.OwnPropertyKeys());
|
|
1464
|
+
if (keys instanceof engine262_mjs.ThrowCompletion) {
|
|
1465
|
+
return {
|
|
1466
|
+
names: []
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
return {
|
|
1470
|
+
names: engine262_mjs.ValueOfNormalCompletion(keys).map(k => k instanceof engine262_mjs.JSStringValue ? k.stringValue() : null).filter(Boolean)
|
|
1471
|
+
};
|
|
1472
|
+
},
|
|
1473
|
+
releaseObject(req, {
|
|
1474
|
+
context
|
|
1475
|
+
}) {
|
|
1476
|
+
context.releaseObject(req.objectId);
|
|
1477
|
+
},
|
|
1478
|
+
releaseObjectGroup({
|
|
1479
|
+
objectGroup
|
|
1480
|
+
}, {
|
|
1481
|
+
context
|
|
1482
|
+
}) {
|
|
1483
|
+
context.releaseObjectGroup(objectGroup);
|
|
1484
|
+
},
|
|
1485
|
+
runIfWaitingForDebugger() {}
|
|
1486
|
+
};
|
|
1487
|
+
const HeapProfiler = {
|
|
1488
|
+
enable() {},
|
|
1489
|
+
collectGarbage() {}
|
|
1490
|
+
};
|
|
1491
|
+
const Target = {
|
|
1492
|
+
setDiscoverTargets() {},
|
|
1493
|
+
// @ts-expect-error no doc
|
|
1494
|
+
setRemoteLocations() {}
|
|
1495
|
+
};
|
|
1496
|
+
const unsupportedError = {
|
|
1497
|
+
result: {
|
|
1498
|
+
type: 'undefined'
|
|
1499
|
+
},
|
|
1500
|
+
exceptionDetails: {
|
|
1501
|
+
text: 'unsupported',
|
|
1502
|
+
lineNumber: 0,
|
|
1503
|
+
columnNumber: 0,
|
|
1504
|
+
exceptionId: 0
|
|
1505
|
+
}
|
|
1506
|
+
};
|
|
1507
|
+
function evaluate(options, inspectorContext) {
|
|
1508
|
+
const {
|
|
1509
|
+
context
|
|
1510
|
+
} = inspectorContext;
|
|
1511
|
+
const isPreview = options.throwOnSideEffect;
|
|
1512
|
+
if (options.awaitPromise) {
|
|
1513
|
+
return unsupportedError;
|
|
1514
|
+
}
|
|
1515
|
+
const realm = context.getRealm(options.uniqueContextId);
|
|
1516
|
+
if (!realm) {
|
|
1517
|
+
return unsupportedError;
|
|
1518
|
+
}
|
|
1519
|
+
const isCallOnFrame = typeof options.callFrameId === 'string';
|
|
1520
|
+
let callOnFramePoppedLevel = 0;
|
|
1521
|
+
const oldExecutionStack = [...engine262_mjs.surroundingAgent.executionContextStack];
|
|
1522
|
+
if (isCallOnFrame) {
|
|
1523
|
+
const frame = engine262_mjs.surroundingAgent.executionContextStack[options.callFrameId];
|
|
1524
|
+
if (!frame) {
|
|
1525
|
+
inspectorContext.sendEvent['Runtime.exceptionThrown']({
|
|
1526
|
+
timestamp: Date.now(),
|
|
1527
|
+
exceptionDetails: {
|
|
1528
|
+
columnNumber: 0,
|
|
1529
|
+
exceptionId: 0,
|
|
1530
|
+
lineNumber: 0,
|
|
1531
|
+
text: `Execution context not found for callFrameId ${options.callFrameId}`
|
|
1532
|
+
}
|
|
1533
|
+
});
|
|
1534
|
+
return unsupportedError;
|
|
1535
|
+
}
|
|
1536
|
+
for (const currentFrame of [...engine262_mjs.surroundingAgent.executionContextStack].reverse()) {
|
|
1537
|
+
if (currentFrame === frame) {
|
|
1538
|
+
break;
|
|
1539
|
+
}
|
|
1540
|
+
callOnFramePoppedLevel += 1;
|
|
1541
|
+
engine262_mjs.surroundingAgent.executionContextStack.pop(currentFrame);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
const promise = new Promise(resolve => {
|
|
1545
|
+
let toBeEvaluated;
|
|
1546
|
+
if (isPreview || options.evalMode === 'console' || isCallOnFrame) {
|
|
1547
|
+
toBeEvaluated = engine262_mjs.performDevtoolsEval(options.expression, realm.realm, false, !!(isPreview || isCallOnFrame));
|
|
1548
|
+
} else {
|
|
1549
|
+
let parsed;
|
|
1550
|
+
const realm = context.getRealm(options.uniqueContextId);
|
|
1551
|
+
if (!realm) {
|
|
1552
|
+
resolve(unsupportedError);
|
|
1553
|
+
return;
|
|
1554
|
+
}
|
|
1555
|
+
if (options.evalMode === 'module') {
|
|
1556
|
+
parsed = engine262_mjs.ParseModule(options.expression, realm.realm);
|
|
1557
|
+
} else {
|
|
1558
|
+
parsed = engine262_mjs.ParseScript(options.expression, realm.realm);
|
|
1559
|
+
}
|
|
1560
|
+
if (Array.isArray(parsed)) {
|
|
1561
|
+
const e = context.createExceptionDetails(engine262_mjs.ThrowCompletion(parsed[0]), false);
|
|
1562
|
+
resolve({
|
|
1563
|
+
exceptionDetails: e,
|
|
1564
|
+
result: {
|
|
1565
|
+
type: 'undefined'
|
|
1566
|
+
}
|
|
1567
|
+
});
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
toBeEvaluated = parsed;
|
|
1571
|
+
}
|
|
1572
|
+
const noDebuggerEvaluate = () => {
|
|
1573
|
+
if (!engine262_mjs.isEvaluator(toBeEvaluated)) {
|
|
1574
|
+
throw new engine262_mjs.Assert.Error('Unexpected');
|
|
1575
|
+
}
|
|
1576
|
+
resolve(context.createEvaluationResult(engine262_mjs.skipDebugger(toBeEvaluated)));
|
|
1577
|
+
};
|
|
1578
|
+
if (isPreview) {
|
|
1579
|
+
engine262_mjs.surroundingAgent.debugger_scopePreview(noDebuggerEvaluate);
|
|
1580
|
+
return;
|
|
1581
|
+
}
|
|
1582
|
+
if (isCallOnFrame) {
|
|
1583
|
+
noDebuggerEvaluate();
|
|
1584
|
+
return;
|
|
1585
|
+
}
|
|
1586
|
+
if (toBeEvaluated instanceof engine262_mjs.ModuleRecord) {
|
|
1587
|
+
realm.realm.evaluateModule(toBeEvaluated, undefined, completion => {
|
|
1588
|
+
if (completion instanceof engine262_mjs.ThrowCompletion) {
|
|
1589
|
+
resolve(context.createEvaluationResult(completion));
|
|
1590
|
+
} else {
|
|
1591
|
+
resolve(context.createEvaluationResult(engine262_mjs.NormalCompletion(engine262_mjs.GetModuleNamespace(toBeEvaluated, 'evaluation'))));
|
|
1592
|
+
}
|
|
1593
|
+
});
|
|
1594
|
+
} else if (toBeEvaluated instanceof engine262_mjs.ScriptRecord) {
|
|
1595
|
+
realm.realm.evaluateScript(toBeEvaluated, {}, completion => {
|
|
1596
|
+
resolve(context.createEvaluationResult(completion));
|
|
1597
|
+
});
|
|
1598
|
+
} else {
|
|
1599
|
+
let completion;
|
|
1600
|
+
engine262_mjs.surroundingAgent.evaluate(toBeEvaluated, c => {
|
|
1601
|
+
completion = c;
|
|
1602
|
+
resolve(context.createEvaluationResult(c));
|
|
1603
|
+
});
|
|
1604
|
+
if (!completion) engine262_mjs.surroundingAgent.resumeEvaluate();
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1607
|
+
promise.then(() => {
|
|
1608
|
+
if (callOnFramePoppedLevel) {
|
|
1609
|
+
engine262_mjs.Assert(oldExecutionStack.length - callOnFramePoppedLevel === engine262_mjs.surroundingAgent.executionContextStack.length);
|
|
1610
|
+
for (const [newIndex, newStack] of engine262_mjs.surroundingAgent.executionContextStack.entries()) {
|
|
1611
|
+
engine262_mjs.Assert(newStack === oldExecutionStack[newIndex]);
|
|
1612
|
+
}
|
|
1613
|
+
engine262_mjs.surroundingAgent.executionContextStack.length = 0;
|
|
1614
|
+
for (const stack of oldExecutionStack) {
|
|
1615
|
+
engine262_mjs.surroundingAgent.executionContextStack.push(stack);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
}, err => {
|
|
1619
|
+
const expr = engine262_mjs.surroundingAgent.runningExecutionContext?.callSite.lastNode?.sourceText;
|
|
1620
|
+
const frame = InspectorContext.callSiteToCallFrame(engine262_mjs.captureStack().stack);
|
|
1621
|
+
// @ts-expect-error
|
|
1622
|
+
// eslint-disable-next-line no-console, @typescript-eslint/no-explicit-any
|
|
1623
|
+
|
|
1624
|
+
if (typeof console === 'object') console.error(err);
|
|
1625
|
+
inspectorContext.sendEvent['Runtime.exceptionThrown']({
|
|
1626
|
+
timestamp: Date.now(),
|
|
1627
|
+
exceptionDetails: {
|
|
1628
|
+
stackTrace: frame.length ? {
|
|
1629
|
+
callFrames: frame
|
|
1630
|
+
} : undefined,
|
|
1631
|
+
text: `engine262 error when evaluating the following node:\n\n ${expr}\n\n${err.constructor.name}: ${err.message}\n${err.stack.slice(err.stack.indexOf(err.message) + err.message.length).split('\n').map(line => ` ${line}`).join('\n')}\n\nFrom now on, the engine262 VM state is broken, please press the reload button.`,
|
|
1632
|
+
columnNumber: frame[0]?.columnNumber,
|
|
1633
|
+
lineNumber: frame[0]?.lineNumber,
|
|
1634
|
+
scriptId: frame[0]?.scriptId,
|
|
1635
|
+
url: frame[0]?.url,
|
|
1636
|
+
exceptionId: 0
|
|
1637
|
+
}
|
|
1638
|
+
});
|
|
1639
|
+
return {
|
|
1640
|
+
result: {
|
|
1641
|
+
type: 'undefined'
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
});
|
|
1645
|
+
return promise;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
var impl = /*#__PURE__*/Object.freeze({
|
|
1649
|
+
__proto__: null,
|
|
1650
|
+
Debugger: Debugger,
|
|
1651
|
+
HeapProfiler: HeapProfiler,
|
|
1652
|
+
Profiler: Profiler,
|
|
1653
|
+
Runtime: Runtime,
|
|
1654
|
+
Target: Target
|
|
1655
|
+
});
|
|
1656
|
+
|
|
1657
|
+
const consoleMethods = ['log', 'debug', 'info', 'error', 'warning', 'dir', 'dirxml', 'table', 'trace', 'clear', 'startGroup', 'startGroupCollapsed', 'endGroup', 'assert', 'profile', 'profileEnd', 'count', 'timeEnd'];
|
|
1658
|
+
function createConsole(realm, defaultBehaviour) {
|
|
1659
|
+
const pop = realm.pushTopContext();
|
|
1660
|
+
const console = engine262_mjs.OrdinaryObjectCreate(realm.Intrinsics['%Object.prototype%']);
|
|
1661
|
+
engine262_mjs.X(engine262_mjs.DefinePropertyOrThrow(realm.GlobalObject, engine262_mjs.Value('console'), engine262_mjs.Descriptor({
|
|
1662
|
+
Configurable: engine262_mjs.Value.true,
|
|
1663
|
+
Enumerable: engine262_mjs.Value.false,
|
|
1664
|
+
Writable: engine262_mjs.Value.true,
|
|
1665
|
+
Value: console
|
|
1666
|
+
})));
|
|
1667
|
+
consoleMethods.forEach(method => {
|
|
1668
|
+
const f = engine262_mjs.CreateBuiltinFunction(function* Console(args) {
|
|
1669
|
+
if (engine262_mjs.surroundingAgent.debugger_isPreviewing) {
|
|
1670
|
+
return engine262_mjs.Value.undefined;
|
|
1671
|
+
}
|
|
1672
|
+
let completion;
|
|
1673
|
+
if (defaultBehaviour[method]) {
|
|
1674
|
+
completion = defaultBehaviour[method](args);
|
|
1675
|
+
} else if (defaultBehaviour.default) {
|
|
1676
|
+
completion = defaultBehaviour.default(method, args);
|
|
1677
|
+
}
|
|
1678
|
+
if (completion) {
|
|
1679
|
+
if (engine262_mjs.isEvaluator(completion)) {
|
|
1680
|
+
completion = yield* completion;
|
|
1681
|
+
}
|
|
1682
|
+
// Do not use Q(host) here. A host may return something invalid like ReturnCompletion.
|
|
1683
|
+
if (completion instanceof engine262_mjs.ThrowCompletion) {
|
|
1684
|
+
return completion;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
if (realm.HostDefined.attachingInspector) {
|
|
1688
|
+
realm.HostDefined.attachingInspector.console(realm, method, args);
|
|
1689
|
+
}
|
|
1690
|
+
return engine262_mjs.Value.undefined;
|
|
1691
|
+
}, 1, engine262_mjs.Value(method), []);
|
|
1692
|
+
engine262_mjs.X(engine262_mjs.CreateDataProperty(console, engine262_mjs.Value(method), f));
|
|
1693
|
+
});
|
|
1694
|
+
pop?.();
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
const ignoreNamespaces = ['Network'];
|
|
1698
|
+
const ignoreMethods = [];
|
|
1699
|
+
class Inspector {
|
|
1700
|
+
#context = new InspectorContext(this);
|
|
1701
|
+
#agents = [];
|
|
1702
|
+
#unhandledExceptionIds = new WeakMap();
|
|
1703
|
+
attachAgent(agent, priorRealms) {
|
|
1704
|
+
const oldOnDebugger = agent.hostDefinedOptions.onDebugger;
|
|
1705
|
+
agent.hostDefinedOptions.onDebugger = reason => {
|
|
1706
|
+
oldOnDebugger?.(reason);
|
|
1707
|
+
const pausedEvent = {
|
|
1708
|
+
reason: reason?.reason ?? 'debugCommand',
|
|
1709
|
+
callFrames: this.#context.getDebuggerCallFrame()
|
|
1710
|
+
};
|
|
1711
|
+
if (reason?.hitBreakpoints) {
|
|
1712
|
+
pausedEvent.hitBreakpoints = [...reason.hitBreakpoints];
|
|
1713
|
+
}
|
|
1714
|
+
this.sendEvent['Debugger.paused'](pausedEvent);
|
|
1715
|
+
};
|
|
1716
|
+
agent.hostDefinedOptions.hostHooks ??= {};
|
|
1717
|
+
agent.hostDefinedOptions.hostHooks.HostPromiseRejectionTrackers ??= new Set();
|
|
1718
|
+
const tracker = (promise, operation) => {
|
|
1719
|
+
if (operation === 'reject') {
|
|
1720
|
+
const detail = this.#context.createExceptionDetails(promise, true);
|
|
1721
|
+
this.#unhandledExceptionIds.set(promise, detail.exceptionId);
|
|
1722
|
+
this.sendEvent['Runtime.exceptionThrown']({
|
|
1723
|
+
timestamp: Date.now(),
|
|
1724
|
+
exceptionDetails: detail
|
|
1725
|
+
});
|
|
1726
|
+
} else {
|
|
1727
|
+
const id = this.#unhandledExceptionIds.get(promise);
|
|
1728
|
+
if (id) {
|
|
1729
|
+
this.sendEvent['Runtime.exceptionRevoked']({
|
|
1730
|
+
reason: 'Handler added to rejected promise',
|
|
1731
|
+
exceptionId: id
|
|
1732
|
+
});
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
agent.hostDefinedOptions.hostHooks.HostPromiseRejectionTrackers.add(tracker);
|
|
1737
|
+
const oldOnRealmCreated = agent.hostDefinedOptions.onRealmCreated;
|
|
1738
|
+
agent.hostDefinedOptions.onRealmCreated = realm => {
|
|
1739
|
+
oldOnRealmCreated?.(realm);
|
|
1740
|
+
this.#context.attachRealm(realm, agent);
|
|
1741
|
+
};
|
|
1742
|
+
const oldOnScriptParsed = agent.hostDefinedOptions.onScriptParsed;
|
|
1743
|
+
agent.hostDefinedOptions.onScriptParsed = (script, id) => {
|
|
1744
|
+
oldOnScriptParsed?.(script, id);
|
|
1745
|
+
const realmId = this.#context.getRealm(script.Realm)?.descriptor.id;
|
|
1746
|
+
if (realmId === undefined) {
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
this.sendEvent['Debugger.scriptParsed'](getParsedEvent(script, id, realmId));
|
|
1750
|
+
};
|
|
1751
|
+
this.#agents.push({
|
|
1752
|
+
agent,
|
|
1753
|
+
onDetach: () => {
|
|
1754
|
+
agent.hostDefinedOptions.onDebugger = oldOnDebugger;
|
|
1755
|
+
agent.hostDefinedOptions.onRealmCreated = oldOnRealmCreated;
|
|
1756
|
+
agent.hostDefinedOptions.onScriptParsed = oldOnScriptParsed;
|
|
1757
|
+
agent.hostDefinedOptions.hostHooks.HostPromiseRejectionTrackers.delete(tracker);
|
|
1758
|
+
this.#agents = this.#agents.filter(x => x.agent !== agent);
|
|
1759
|
+
}
|
|
1760
|
+
});
|
|
1761
|
+
priorRealms.forEach(realm => {
|
|
1762
|
+
this.#context.attachRealm(realm, agent);
|
|
1763
|
+
});
|
|
1764
|
+
}
|
|
1765
|
+
detachAgent(agent) {
|
|
1766
|
+
const record = this.#agents.find(x => x.agent === agent);
|
|
1767
|
+
record?.onDetach();
|
|
1768
|
+
this.#context.detachAgent(agent);
|
|
1769
|
+
}
|
|
1770
|
+
preference = {
|
|
1771
|
+
previewDebug: false
|
|
1772
|
+
};
|
|
1773
|
+
onMessage(id, methodArg, params) {
|
|
1774
|
+
if (ignoreMethods.includes(methodArg)) {
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
const [namespace, method] = methodArg.split('.');
|
|
1778
|
+
if (ignoreNamespaces.includes(namespace)) {
|
|
1779
|
+
return;
|
|
1780
|
+
}
|
|
1781
|
+
if (!(namespace in impl)) {
|
|
1782
|
+
this.sendEvent['Runtime.consoleAPICalled']({
|
|
1783
|
+
timestamp: Date.now(),
|
|
1784
|
+
type: 'warning',
|
|
1785
|
+
executionContextId: 0,
|
|
1786
|
+
args: [{
|
|
1787
|
+
type: 'string',
|
|
1788
|
+
value: `engine262 internal error: Namespace not implemented: ${namespace}.*`
|
|
1789
|
+
}]
|
|
1790
|
+
});
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
const ns = impl[namespace];
|
|
1794
|
+
if (!(method in ns)) {
|
|
1795
|
+
this.sendEvent['Runtime.consoleAPICalled']({
|
|
1796
|
+
timestamp: Date.now(),
|
|
1797
|
+
type: 'warning',
|
|
1798
|
+
executionContextId: 0,
|
|
1799
|
+
args: [{
|
|
1800
|
+
type: 'string',
|
|
1801
|
+
value: `engine262 internal error: Method not implemented: ${namespace}.${method}`
|
|
1802
|
+
}]
|
|
1803
|
+
});
|
|
1804
|
+
return;
|
|
1805
|
+
}
|
|
1806
|
+
const f = ns[method];
|
|
1807
|
+
new Promise(resolve => {
|
|
1808
|
+
resolve(f(params, this.#debugContext));
|
|
1809
|
+
}).then((result = {}) => {
|
|
1810
|
+
this.send({
|
|
1811
|
+
id,
|
|
1812
|
+
result
|
|
1813
|
+
});
|
|
1814
|
+
});
|
|
1815
|
+
}
|
|
1816
|
+
sendEvent = Object.create(new Proxy({}, {
|
|
1817
|
+
get: (_, key) => {
|
|
1818
|
+
const f = params => {
|
|
1819
|
+
if (this.#debuggerAttached) {
|
|
1820
|
+
this.send({
|
|
1821
|
+
method: key,
|
|
1822
|
+
params
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
Object.defineProperty(this.sendEvent, key, {
|
|
1827
|
+
value: f
|
|
1828
|
+
});
|
|
1829
|
+
return f;
|
|
1830
|
+
}
|
|
1831
|
+
}));
|
|
1832
|
+
console(realm, type, args) {
|
|
1833
|
+
const context = this.#context.getRealm(realm);
|
|
1834
|
+
if (!context) {
|
|
1835
|
+
return;
|
|
1836
|
+
}
|
|
1837
|
+
this.sendEvent['Runtime.consoleAPICalled']({
|
|
1838
|
+
type,
|
|
1839
|
+
args: args.map(x => this.#context.toRemoteObject(x, {})),
|
|
1840
|
+
executionContextId: context.descriptor.id,
|
|
1841
|
+
timestamp: Date.now()
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
#debuggerAttached = false;
|
|
1845
|
+
onDebuggerDisconnect() {
|
|
1846
|
+
this.#debuggerAttached = false;
|
|
1847
|
+
}
|
|
1848
|
+
#onDebuggerConnected() {
|
|
1849
|
+
this.#context.realms.forEach(realm => {
|
|
1850
|
+
if (realm) {
|
|
1851
|
+
this.sendEvent['Runtime.executionContextCreated']({
|
|
1852
|
+
context: realm.descriptor
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
});
|
|
1856
|
+
this.#agents.forEach(({
|
|
1857
|
+
agent
|
|
1858
|
+
}) => {
|
|
1859
|
+
agent.parsedSources.forEach((script, id) => {
|
|
1860
|
+
const realmId = this.#context.getRealm(script.Realm)?.descriptor.id;
|
|
1861
|
+
if (realmId === undefined) {
|
|
1862
|
+
return;
|
|
1863
|
+
}
|
|
1864
|
+
this.sendEvent['Debugger.scriptParsed'](getParsedEvent(script, id, realmId));
|
|
1865
|
+
});
|
|
1866
|
+
});
|
|
1867
|
+
}
|
|
1868
|
+
#debugContext = {
|
|
1869
|
+
sendEvent: this.sendEvent,
|
|
1870
|
+
preference: this.preference,
|
|
1871
|
+
context: this.#context,
|
|
1872
|
+
onDebuggerConnect: () => {
|
|
1873
|
+
if (!this.#debuggerAttached) {
|
|
1874
|
+
this.#debuggerAttached = true;
|
|
1875
|
+
this.#onDebuggerConnected();
|
|
1876
|
+
}
|
|
1877
|
+
},
|
|
1878
|
+
onDebuggerDisconnect: () => {
|
|
1879
|
+
this.#debuggerAttached = false;
|
|
1880
|
+
}
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
exports.Inspector = Inspector;
|
|
1885
|
+
exports.createConsole = createConsole;
|
|
1886
|
+
|
|
1887
|
+
}));
|
|
1888
|
+
//# sourceMappingURL=inspector.js.map
|