Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(880)

Unified Diff: src/objects.cc

Issue 1156573002: [strong] Implement per-object restrictions behaviour of delete operator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 180eb63536c1f35bf5d07189478a81c55951d281..3339b6d127696e0c929177bc5fa95604bad497bf 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -5467,9 +5467,16 @@ MaybeHandle<Object> JSObject::DeleteProperty(Handle<JSObject> object,
}
// Fall through.
case LookupIterator::ACCESSOR: {
- if (!it.IsConfigurable()) {
- // Fail if the property is not configurable.
+ if (!it.IsConfigurable() || object->map()->is_strong()) {
+ // Fail if the property is not configurable, or on a strong object.
if (is_strict(language_mode)) {
+ if (object->map()->is_strong()) {
+ THROW_NEW_ERROR(
+ it.isolate(),
+ NewTypeError(MessageTemplate::kStrongDeleteProperty, object,
+ name),
+ Object);
+ }
THROW_NEW_ERROR(it.isolate(),
NewTypeError(MessageTemplate::kStrictDeleteProperty,
name, object),
« no previous file with comments | « src/messages.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698