Skip to content

Commit

Permalink
Fix addIntrinsics(getAnonymousIntrinsics())
Browse files Browse the repository at this point in the history
  • Loading branch information
leotm committed Apr 17, 2024
1 parent ad630b7 commit cb44efd
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions ses.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9901,25 +9901,42 @@ const getAnonymousIntrinsics= ()=> {
// eslint-disable-next-line no-empty-function
async function* AsyncGeneratorFunctionInstance() { }
const AsyncGeneratorFunction= getConstructorOf(
AsyncGeneratorFunctionInstance);
AsyncGeneratorFunctionInstance); // fn [bytecode]
// throw AsyncGeneratorFunction.prototype; // fn [native code]
// throw AsyncGeneratorFunction.prototype.prototype; // undefined



// 25.3.2.2 AsyncGeneratorFunction.prototype
const AsyncGenerator= AsyncGeneratorFunction.prototype;
const AsyncGenerator= AsyncGeneratorFunction.prototype; // fn [native code]
// throw AsyncGenerator.prototype; // undefined

const asyncIterable = {
async *[Symbol.asyncIterator]() {

}
};
// throw asyncIterable[Symbol.asyncIterator]; // fn [bytecode]

const asyncIterator = asyncIterable[Symbol.asyncIterator]();
// throw Object.keys(asyncIterator); // _invoke

// 25.5.1 Properties of the AsyncGenerator Prototype Object
const AsyncGeneratorPrototype= AsyncGenerator.prototype;
const AsyncIteratorPrototype= getPrototypeOf(AsyncGeneratorPrototype);
const AsyncGeneratorPrototype= AsyncGenerator.prototype; // undefined
const AsyncIteratorPrototype= getPrototypeOf(asyncIterator);
// throw Object.keys(AsyncIteratorPrototype); // @@asyncIterator,next,throw,return

// 25.7.1 The AsyncFunction Constructor

// eslint-disable-next-line no-empty-function
async function AsyncFunctionInstance() { }
const AsyncFunction= getConstructorOf(AsyncFunctionInstance);
const AsyncFunctionInstance = (0,eval)('(async function () { })'); // async fn [bytecode]
// async function AsyncFunctionInstance() { } // fn [bytecode]
const AsyncFunction= getConstructorOf(AsyncFunctionInstance); // fn [bytecode]

const intrinsics= {
'%InertFunction%': InertFunction,
'%ArrayIteratorPrototype%': ArrayIteratorPrototype,
'%InertAsyncFunction%': AsyncFunction,
'%InertAsyncFunction%': AsyncFunction, // sync, not async
'%AsyncGenerator%': AsyncGenerator,
'%InertAsyncGeneratorFunction%': AsyncGeneratorFunction,
'%AsyncGeneratorPrototype%': AsyncGeneratorPrototype,
Expand Down Expand Up @@ -10552,7 +10569,7 @@ const repairIntrinsics= (options= {})=> {
addIntrinsics(tameRegExpConstructor(regExpTaming));
addIntrinsics(tameSymbolConstructor());

// addIntrinsics(getAnonymousIntrinsics()); // TODO
addIntrinsics(getAnonymousIntrinsics());

// completePrototypes(); // TODO

Expand Down

0 comments on commit cb44efd

Please sign in to comment.