Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
6.8
-
None
Description
In strict mode, the following code produces a type error, when executed from QML (by imorting a .js file or by having it directly in a .qml file):
var foo = new WeakMap(); foo.set = ...; // <- TypeError
The code seems to fail on a `SetLookup` instruction for the assignment, producing a `TypeError` when in strict mode:
MOTH_BEGIN_INSTR(SetLookup) STORE_IP(); STORE_ACC(); QV4::Lookup *l = function->executableCompilationUnit()->runtimeLookups + index; if (!l->setter(l, engine, STACK_VALUE(base), accumulator) && function->isStrict()) engine->throwTypeError(); // <- Here CHECK_EXCEPTION; MOTH_END_INSTR(SetLookup)
This seems specific to the usage of `WeakMap` as the same code doesn't produce an error when used, for example, with an `Array`.
Attachments
Issue Links
- is required for
-
QTBUG-126342 Math.js 9.4.4 and later does not work
- Reported
- relates to
-
QTBUG-84341 ECMAScript / Javascript Engine builtin objects are immutable (frozen)
- Open