123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458 |
- // Copyright (C) 2018 the V8 project authors. All rights reserved.
- // This code is governed by the BSD license found in the LICENSE file.
- /*---
- description: |
- An Array of all representable Well-Known Intrinsic Objects
- ---*/
- const WellKnownIntrinsicObjects = [
- {
- intrinsicName: "%Array%",
- globalNameOrSource: "Array"
- },
- {
- intrinsicName: "%ArrayBuffer%",
- globalNameOrSource: "ArrayBuffer"
- },
- {
- intrinsicName: "%ArrayBufferPrototype%",
- globalNameOrSource: "ArrayBuffer.prototype"
- },
- {
- intrinsicName: "%ArrayIteratorPrototype%",
- globalNameOrSource: "Object.getPrototypeOf([][Symbol.iterator]())"
- },
- {
- intrinsicName: "%ArrayPrototype%",
- globalNameOrSource: "Array.prototype"
- },
- {
- intrinsicName: "%ArrayProto_entries%",
- globalNameOrSource: "Array.prototype.entries"
- },
- {
- intrinsicName: "%ArrayProto_forEach%",
- globalNameOrSource: "Array.prototype.forEach"
- },
- {
- intrinsicName: "%ArrayProto_keys%",
- globalNameOrSource: "Array.prototype.keys"
- },
- {
- intrinsicName: "%ArrayProto_values%",
- globalNameOrSource: "Array.prototype.values"
- },
- {
- intrinsicName: "%AsyncFromSyncIteratorPrototype%",
- globalNameOrSource: "undefined"
- },
- {
- intrinsicName: "%AsyncFunction%",
- globalNameOrSource: "(async function() {}).constructor"
- },
- {
- intrinsicName: "%AsyncFunctionPrototype%",
- globalNameOrSource: "(async function() {}).constructor.prototype"
- },
- {
- intrinsicName: "%AsyncGenerator%",
- globalNameOrSource: "Object.getPrototypeOf((async function * () {})())"
- },
- {
- intrinsicName: "%AsyncGeneratorFunction%",
- globalNameOrSource: "Object.getPrototypeOf(async function * () {})"
- },
- {
- intrinsicName: "%AsyncGeneratorPrototype%",
- globalNameOrSource: "Object.getPrototypeOf(async function * () {}).prototype"
- },
- {
- intrinsicName: "%AsyncIteratorPrototype%",
- globalNameOrSource: "((async function * () {})())[Symbol.asyncIterator]()"
- },
- {
- intrinsicName: "%Atomics%",
- globalNameOrSource: "Atomics"
- },
- {
- intrinsicName: "%Boolean%",
- globalNameOrSource: "Boolean"
- },
- {
- intrinsicName: "%BooleanPrototype%",
- globalNameOrSource: "Boolean.prototype"
- },
- {
- intrinsicName: "%DataView%",
- globalNameOrSource: "DataView"
- },
- {
- intrinsicName: "%DataViewPrototype%",
- globalNameOrSource: "DataView.prototype"
- },
- {
- intrinsicName: "%Date%",
- globalNameOrSource: "Date"
- },
- {
- intrinsicName: "%DatePrototype%",
- globalNameOrSource: "Date.prototype"
- },
- {
- intrinsicName: "%decodeURI%",
- globalNameOrSource: "decodeURI"
- },
- {
- intrinsicName: "%decodeURIComponent%",
- globalNameOrSource: "decodeURIComponent"
- },
- {
- intrinsicName: "%encodeURI%",
- globalNameOrSource: "encodeURI"
- },
- {
- intrinsicName: "%encodeURIComponent%",
- globalNameOrSource: "encodeURIComponent"
- },
- {
- intrinsicName: "%Error%",
- globalNameOrSource: "Error"
- },
- {
- intrinsicName: "%ErrorPrototype%",
- globalNameOrSource: "Error.prototype"
- },
- {
- intrinsicName: "%eval%",
- globalNameOrSource: "eval"
- },
- {
- intrinsicName: "%EvalError%",
- globalNameOrSource: "EvalError"
- },
- {
- intrinsicName: "%EvalErrorPrototype%",
- globalNameOrSource: "EvalError.prototype"
- },
- {
- intrinsicName: "%Float32Array%",
- globalNameOrSource: "Float32Array"
- },
- {
- intrinsicName: "%Float32ArrayPrototype%",
- globalNameOrSource: "Float32Array.prototype"
- },
- {
- intrinsicName: "%Float64Array%",
- globalNameOrSource: "Float64Array"
- },
- {
- intrinsicName: "%Float64ArrayPrototype%",
- globalNameOrSource: "Float64Array.prototype"
- },
- {
- intrinsicName: "%Function%",
- globalNameOrSource: "Function"
- },
- {
- intrinsicName: "%FunctionPrototype%",
- globalNameOrSource: "Function.prototype"
- },
- {
- intrinsicName: "%Generator%",
- globalNameOrSource: "Object.getPrototypeOf((function * () {})())"
- },
- {
- intrinsicName: "%GeneratorFunction%",
- globalNameOrSource: "Object.getPrototypeOf(function * () {})"
- },
- {
- intrinsicName: "%GeneratorPrototype%",
- globalNameOrSource: "Object.getPrototypeOf(function * () {}).prototype"
- },
- {
- intrinsicName: "%Int8Array%",
- globalNameOrSource: "Int8Array"
- },
- {
- intrinsicName: "%Int8ArrayPrototype%",
- globalNameOrSource: "Int8Array.prototype"
- },
- {
- intrinsicName: "%Int16Array%",
- globalNameOrSource: "Int16Array"
- },
- {
- intrinsicName: "%Int16ArrayPrototype%",
- globalNameOrSource: "Int16Array.prototype"
- },
- {
- intrinsicName: "%Int32Array%",
- globalNameOrSource: "Int32Array"
- },
- {
- intrinsicName: "%Int32ArrayPrototype%",
- globalNameOrSource: "Int32Array.prototype"
- },
- {
- intrinsicName: "%isFinite%",
- globalNameOrSource: "isFinite"
- },
- {
- intrinsicName: "%isNaN%",
- globalNameOrSource: "isNaN"
- },
- {
- intrinsicName: "%IteratorPrototype%",
- globalNameOrSource: "Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))"
- },
- {
- intrinsicName: "%JSON%",
- globalNameOrSource: "JSON"
- },
- {
- intrinsicName: "%JSONParse%",
- globalNameOrSource: "JSON.parse"
- },
- {
- intrinsicName: "%Map%",
- globalNameOrSource: "Map"
- },
- {
- intrinsicName: "%MapIteratorPrototype%",
- globalNameOrSource: "Object.getPrototypeOf(new Map()[Symbol.iterator]())"
- },
- {
- intrinsicName: "%MapPrototype%",
- globalNameOrSource: "Map.prototype"
- },
- {
- intrinsicName: "%Math%",
- globalNameOrSource: "Math"
- },
- {
- intrinsicName: "%Number%",
- globalNameOrSource: "Number"
- },
- {
- intrinsicName: "%NumberPrototype%",
- globalNameOrSource: "Number.prototype"
- },
- {
- intrinsicName: "%Object%",
- globalNameOrSource: "Object"
- },
- {
- intrinsicName: "%ObjectPrototype%",
- globalNameOrSource: "Object.prototype"
- },
- {
- intrinsicName: "%ObjProto_toString%",
- globalNameOrSource: "Object.prototype.toString"
- },
- {
- intrinsicName: "%ObjProto_valueOf%",
- globalNameOrSource: "Object.prototype.valueOf"
- },
- {
- intrinsicName: "%parseFloat%",
- globalNameOrSource: "parseFloat"
- },
- {
- intrinsicName: "%parseInt%",
- globalNameOrSource: "parseInt"
- },
- {
- intrinsicName: "%Promise%",
- globalNameOrSource: "Promise"
- },
- {
- intrinsicName: "%PromisePrototype%",
- globalNameOrSource: "Promise.prototype"
- },
- {
- intrinsicName: "%PromiseProto_then%",
- globalNameOrSource: "Promise.prototype.then"
- },
- {
- intrinsicName: "%Promise_all%",
- globalNameOrSource: "Promise.all"
- },
- {
- intrinsicName: "%Promise_reject%",
- globalNameOrSource: "Promise.reject"
- },
- {
- intrinsicName: "%Promise_resolve%",
- globalNameOrSource: "Promise.resolve"
- },
- {
- intrinsicName: "%Proxy%",
- globalNameOrSource: "Proxy"
- },
- {
- intrinsicName: "%RangeError%",
- globalNameOrSource: "RangeError"
- },
- {
- intrinsicName: "%RangeErrorPrototype%",
- globalNameOrSource: "RangeError.prototype"
- },
- {
- intrinsicName: "%ReferenceError%",
- globalNameOrSource: "ReferenceError"
- },
- {
- intrinsicName: "%ReferenceErrorPrototype%",
- globalNameOrSource: "ReferenceError.prototype"
- },
- {
- intrinsicName: "%Reflect%",
- globalNameOrSource: "Reflect"
- },
- {
- intrinsicName: "%RegExp%",
- globalNameOrSource: "RegExp"
- },
- {
- intrinsicName: "%RegExpPrototype%",
- globalNameOrSource: "RegExp.prototype"
- },
- {
- intrinsicName: "%Set%",
- globalNameOrSource: "Set"
- },
- {
- intrinsicName: "%SetIteratorPrototype%",
- globalNameOrSource: "Object.getPrototypeOf(new Set()[Symbol.iterator]())"
- },
- {
- intrinsicName: "%SetPrototype%",
- globalNameOrSource: "Set.prototype"
- },
- {
- intrinsicName: "%SharedArrayBuffer%",
- globalNameOrSource: "SharedArrayBuffer"
- },
- {
- intrinsicName: "%SharedArrayBufferPrototype%",
- globalNameOrSource: "SharedArrayBuffer.prototype"
- },
- {
- intrinsicName: "%String%",
- globalNameOrSource: "String"
- },
- {
- intrinsicName: "%StringIteratorPrototype%",
- globalNameOrSource: "Object.getPrototypeOf(new String()[Symbol.iterator]())"
- },
- {
- intrinsicName: "%StringPrototype%",
- globalNameOrSource: "String.prototype"
- },
- {
- intrinsicName: "%Symbol%",
- globalNameOrSource: "Symbol"
- },
- {
- intrinsicName: "%SymbolPrototype%",
- globalNameOrSource: "Symbol.prototype"
- },
- {
- intrinsicName: "%SyntaxError%",
- globalNameOrSource: "SyntaxError"
- },
- {
- intrinsicName: "%SyntaxErrorPrototype%",
- globalNameOrSource: "SyntaxError.prototype"
- },
- {
- intrinsicName: "%ThrowTypeError%",
- globalNameOrSource: "(function() { 'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'callee').get })()"
- },
- {
- intrinsicName: "%TypedArray%",
- globalNameOrSource: "Object.getPrototypeOf(Uint8Array)"
- },
- {
- intrinsicName: "%TypedArrayPrototype%",
- globalNameOrSource: "Object.getPrototypeOf(Uint8Array).prototype"
- },
- {
- intrinsicName: "%TypeError%",
- globalNameOrSource: "TypeError"
- },
- {
- intrinsicName: "%TypeErrorPrototype%",
- globalNameOrSource: "TypeError.prototype"
- },
- {
- intrinsicName: "%Uint8Array%",
- globalNameOrSource: "Uint8Array"
- },
- {
- intrinsicName: "%Uint8ArrayPrototype%",
- globalNameOrSource: "Uint8Array.prototype"
- },
- {
- intrinsicName: "%Uint8ClampedArray%",
- globalNameOrSource: "Uint8ClampedArray"
- },
- {
- intrinsicName: "%Uint8ClampedArrayPrototype%",
- globalNameOrSource: "Uint8ClampedArray.prototype"
- },
- {
- intrinsicName: "%Uint16Array%",
- globalNameOrSource: "Uint16Array"
- },
- {
- intrinsicName: "%Uint16ArrayPrototype%",
- globalNameOrSource: "Uint16Array.prototype"
- },
- {
- intrinsicName: "%Uint32Array%",
- globalNameOrSource: "Uint32Array"
- },
- {
- intrinsicName: "%Uint32ArrayPrototype%",
- globalNameOrSource: "Uint32Array.prototype"
- },
- {
- intrinsicName: "%URIError%",
- globalNameOrSource: "URIError"
- },
- {
- intrinsicName: "%URIErrorPrototype%",
- globalNameOrSource: "URIError.prototype"
- },
- {
- intrinsicName: "%WeakMap%",
- globalNameOrSource: "WeakMap"
- },
- {
- intrinsicName: "%WeakMapPrototype%",
- globalNameOrSource: "WeakMap.prototype"
- },
- {
- intrinsicName: "%WeakSet%",
- globalNameOrSource: "WeakSet"
- },
- {
- intrinsicName: "%WeakSetPrototype%",
- globalNameOrSource: "WeakSet.prototype"
- }
- ];
- WellKnownIntrinsicObjects.forEach(wkio => {
- var actual;
- try {
- actual = new Function("return " + wkio.globalNameOrSource)();
- } catch (exception) {
- // Nothing to do here.
- }
- wkio.reference = actual;
- });
|