Skip to content
New issue

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

Fix for #616 #617

Merged
merged 2 commits into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/org/mozilla/javascript/ScriptableObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -2804,20 +2804,18 @@ private boolean putImpl(Object key, int index, Scriptable start,
{
// This method is very hot (basically called on each assignment)
// so we inline the extensible/sealed checks below.
if (!isExtensible) {
Context cx = Context.getContext();
if (cx.isStrictMode()) {
throw ScriptRuntime.typeError0("msg.not.extensible");
}
}
Slot slot;
if (this != start) {
slot = slotMap.query(key, index);
if(!isExtensible && Context.getContext().isStrictMode() && (slot == null || !(slot instanceof GetterSlot)))
throw ScriptRuntime.typeError0("msg.not.extensible");
if (slot == null) {
return false;
}
} else if (!isExtensible) {
slot = slotMap.query(key, index);
if(Context.getContext().isStrictMode() && (slot == null || !(slot instanceof GetterSlot)))
throw ScriptRuntime.typeError0("msg.not.extensible");
if (slot == null) {
return true;
}
Expand Down
3 changes: 0 additions & 3 deletions testsrc/test262.properties
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,6 @@ built-ins/Object
! entries/tamper-with-object-keys.js
! freeze/15.2.3.9-2-a-12.js
! freeze/15.2.3.9-2-a-8.js
! freeze/15.2.3.9-2-c-2.js
! freeze/15.2.3.9-2-c-3.js
! freeze/15.2.3.9-2-c-4.js
! freeze/15.2.3.9-2-d-3.js
! freeze/frozen-object-contains-symbol-properties-non-strict.js
! getOwnPropertyDescriptor/15.2.3.3-3-14.js
Expand Down