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

Unified Diff: src/objects.cc

Issue 11094021: Fix bug in deletion of indexed properties (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Replace api test by mjsunit test Created 8 years, 2 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/elements.cc ('k') | test/mjsunit/delete-non-configurable.js » ('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 7dcefa2da6c4643ccdda8f8ce4ec76b27d33fb21..3ac771d39bbef459d958b55917af93d29d2827f2 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -3943,6 +3943,21 @@ MaybeObject* JSObject::DeleteProperty(String* name, DeleteMode mode) {
return isolate->heap()->false_value();
}
+ if (IsStringObjectWithCharacterAt(index)) {
Michael Starzinger 2012/10/15 15:20:39 This was moved from DeleteElement() to DeletePrope
Peter Varga 2012/10/15 15:25:34 This is on purpose. Based on ECMA standard it shou
Michael Starzinger 2012/10/15 15:30:19 I totally agree but that wasn't the point of my co
Peter Varga 2012/10/15 15:48:23 I see the problem now. It seems git applied the pa
+ if (mode == STRICT_DELETION) {
+ // Deleting a non-configurable property in strict mode.
+ HandleScope scope(isolate);
+ Handle<Object> holder(this);
+ Handle<Object> name = isolate->factory()->NewNumberFromUint(index);
+ Handle<Object> args[2] = { name, holder };
+ Handle<Object> error =
+ isolate->factory()->NewTypeError("strict_delete_property",
+ HandleVector(args, 2));
+ return isolate->Throw(*error);
+ }
+ return isolate->heap()->false_value();
+ }
+
if (IsJSGlobalProxy()) {
Object* proto = GetPrototype();
if (proto->IsNull()) return isolate->heap()->false_value();
« no previous file with comments | « src/elements.cc ('k') | test/mjsunit/delete-non-configurable.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698