bytecodealliance / javy

JS to WebAssembly toolchain
Apache License 2.0
2.1k stars 101 forks source link

accessing arguments.callee leads to TypeError: invalid property access #645

Closed truff77 closed 2 months ago

truff77 commented 2 months ago

Hello,

I'm trying to use this javascript code:

function myFunction() {
  console.log(arguments.callee);
}

myFunction();

and it generates TypeError: invalid property access.

Is this a normal behavior ?

thank you in advance !

jeffcharles commented 2 months ago

Yes this is normal behaviour. Javy compiles and executes the provided JS as an ESM module which implies strict mode and arguments.callee is not allowed in strict mode.

truff77 commented 2 months ago

Hi @jeffcharles thank you for the fast answer, this makes total sense now !