Skip to content

Strict async function expressions lack arguments.callee protection #3590

Closed

Description

@nickna

An async function expression in a sloppy script can declare its own "use strict" directive. Reading arguments.callee inside that expression should throw TypeError.

const run = async function () {
    "use strict";
    try { console.log('read', arguments.callee); }
    catch (error) { console.log('caught', error instanceof TypeError); }
};
run();

Node v22.23.2 prints caught true. Interpreted and compiled SharpTS both print read undefined on the baseline before the #3552 follow-up changes and on the branch for PR #3577. Both saved assemblies pass full IL verification. Run as classic JavaScript with --no-tsconfig --noLib. To test compiled output, add --compile repro.js --verify -o repro.dll and then run dotnet repro.dll.

This is separate from #3549, which covers deleting an absent numeric index on a sealed arguments object.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions