We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new
found out while working on Promises fixing this test: https://github.com/tc39/test262/blob/main/test/built-ins/Promise/undefined-newtarget.js
relevant snippet:
var p = new Promise(function() {}); assert.throws(TypeError, function() { Promise.call(p, function() {}); });
as it turned out the same applies for Map and Set (and possibly other built-ins). this snippet should throw a type error
const m = new Map(); Map.call(m,[]); // TypeError: Constructor Map requires 'new'
but works fine in Jint.
My understanding that Call method should just always throw, like so:
Call
public override JsValue Call(JsValue thisObject, JsValue[] arguments) { return ExceptionHelper.ThrowTypeError<JsValue>(_engine, "Constructor Map requires 'new'"); }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
found out while working on Promises fixing this test: https://github.com/tc39/test262/blob/main/test/built-ins/Promise/undefined-newtarget.js
relevant snippet:
as it turned out the same applies for Map and Set (and possibly other built-ins).
this snippet should throw a type error
but works fine in Jint.
My understanding that
Call
method should just always throw, like so:The text was updated successfully, but these errors were encountered: