fixed define own property with writable=false on module namespace
This commit is contained in:
parent
c3599515c8
commit
3ba181e6c6
2 changed files with 7 additions and 4 deletions
10
quickjs.c
10
quickjs.c
|
@ -9081,15 +9081,19 @@ int JS_DefineProperty(JSContext *ctx, JSValueConst this_obj,
|
||||||
spaces. */
|
spaces. */
|
||||||
if (!js_same_value(ctx, val, *pr->u.var_ref->pvalue))
|
if (!js_same_value(ctx, val, *pr->u.var_ref->pvalue))
|
||||||
goto not_configurable;
|
goto not_configurable;
|
||||||
|
} else {
|
||||||
|
/* update the reference */
|
||||||
|
set_value(ctx, pr->u.var_ref->pvalue,
|
||||||
|
JS_DupValue(ctx, val));
|
||||||
}
|
}
|
||||||
/* update the reference */
|
|
||||||
set_value(ctx, pr->u.var_ref->pvalue,
|
|
||||||
JS_DupValue(ctx, val));
|
|
||||||
}
|
}
|
||||||
/* if writable is set to false, no longer a
|
/* if writable is set to false, no longer a
|
||||||
reference (for mapped arguments) */
|
reference (for mapped arguments) */
|
||||||
if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) == JS_PROP_HAS_WRITABLE) {
|
if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) == JS_PROP_HAS_WRITABLE) {
|
||||||
JSValue val1;
|
JSValue val1;
|
||||||
|
if (p->class_id == JS_CLASS_MODULE_NS) {
|
||||||
|
return JS_ThrowTypeErrorOrFalse(ctx, flags, "module namespace properties have writable = false");
|
||||||
|
}
|
||||||
if (js_shape_prepare_update(ctx, p, &prs))
|
if (js_shape_prepare_update(ctx, p, &prs))
|
||||||
return -1;
|
return -1;
|
||||||
val1 = JS_DupValue(ctx, *pr->u.var_ref->pvalue);
|
val1 = JS_DupValue(ctx, *pr->u.var_ref->pvalue);
|
||||||
|
|
|
@ -18,7 +18,6 @@ test262/test/language/expressions/dynamic-import/usage-from-eval.js:26: strict m
|
||||||
test262/test/language/expressions/optional-chaining/optional-call-preserves-this.js:21: TypeError: cannot read property 'c' of undefined
|
test262/test/language/expressions/optional-chaining/optional-call-preserves-this.js:21: TypeError: cannot read property 'c' of undefined
|
||||||
test262/test/language/expressions/optional-chaining/optional-call-preserves-this.js:15: strict mode: TypeError: cannot read property '_b' of undefined
|
test262/test/language/expressions/optional-chaining/optional-call-preserves-this.js:15: strict mode: TypeError: cannot read property '_b' of undefined
|
||||||
test262/test/language/global-code/script-decl-lex-var-declared-via-eval-sloppy.js:13: Test262Error: variable Expected a SyntaxError to be thrown but no exception was thrown at all
|
test262/test/language/global-code/script-decl-lex-var-declared-via-eval-sloppy.js:13: Test262Error: variable Expected a SyntaxError to be thrown but no exception was thrown at all
|
||||||
test262/test/language/module-code/namespace/internals/define-own-property.js:30: Test262Error: Object.freeze: 1 Expected a TypeError to be thrown but no exception was thrown at all
|
|
||||||
test262/test/language/statements/async-generator/yield-star-promise-not-unwrapped.js:25: TypeError: $DONE() not called
|
test262/test/language/statements/async-generator/yield-star-promise-not-unwrapped.js:25: TypeError: $DONE() not called
|
||||||
test262/test/language/statements/async-generator/yield-star-promise-not-unwrapped.js:25: strict mode: TypeError: $DONE() not called
|
test262/test/language/statements/async-generator/yield-star-promise-not-unwrapped.js:25: strict mode: TypeError: $DONE() not called
|
||||||
test262/test/language/statements/async-generator/yield-star-return-then-getter-ticks.js:131: TypeError: $DONE() not called
|
test262/test/language/statements/async-generator/yield-star-return-then-getter-ticks.js:131: TypeError: $DONE() not called
|
||||||
|
|
Loading…
Reference in a new issue