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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/elements.cc ('k') | test/mjsunit/delete-non-configurable.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3925 matching lines...) Expand 10 before | Expand all | Expand 10 after
3936 // ECMA-262, 3rd, 8.6.2.5 3936 // ECMA-262, 3rd, 8.6.2.5
3937 ASSERT(name->IsString()); 3937 ASSERT(name->IsString());
3938 3938
3939 // Check access rights if needed. 3939 // Check access rights if needed.
3940 if (IsAccessCheckNeeded() && 3940 if (IsAccessCheckNeeded() &&
3941 !isolate->MayNamedAccess(this, name, v8::ACCESS_DELETE)) { 3941 !isolate->MayNamedAccess(this, name, v8::ACCESS_DELETE)) {
3942 isolate->ReportFailedAccessCheck(this, v8::ACCESS_DELETE); 3942 isolate->ReportFailedAccessCheck(this, v8::ACCESS_DELETE);
3943 return isolate->heap()->false_value(); 3943 return isolate->heap()->false_value();
3944 } 3944 }
3945 3945
3946 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
3947 if (mode == STRICT_DELETION) {
3948 // Deleting a non-configurable property in strict mode.
3949 HandleScope scope(isolate);
3950 Handle<Object> holder(this);
3951 Handle<Object> name = isolate->factory()->NewNumberFromUint(index);
3952 Handle<Object> args[2] = { name, holder };
3953 Handle<Object> error =
3954 isolate->factory()->NewTypeError("strict_delete_property",
3955 HandleVector(args, 2));
3956 return isolate->Throw(*error);
3957 }
3958 return isolate->heap()->false_value();
3959 }
3960
3946 if (IsJSGlobalProxy()) { 3961 if (IsJSGlobalProxy()) {
3947 Object* proto = GetPrototype(); 3962 Object* proto = GetPrototype();
3948 if (proto->IsNull()) return isolate->heap()->false_value(); 3963 if (proto->IsNull()) return isolate->heap()->false_value();
3949 ASSERT(proto->IsJSGlobalObject()); 3964 ASSERT(proto->IsJSGlobalObject());
3950 return JSGlobalObject::cast(proto)->DeleteProperty(name, mode); 3965 return JSGlobalObject::cast(proto)->DeleteProperty(name, mode);
3951 } 3966 }
3952 3967
3953 uint32_t index = 0; 3968 uint32_t index = 0;
3954 if (name->AsArrayIndex(&index)) { 3969 if (name->AsArrayIndex(&index)) {
3955 return DeleteElement(index, mode); 3970 return DeleteElement(index, mode);
(...skipping 9558 matching lines...) Expand 10 before | Expand all | Expand 10 after
13514 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13529 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13515 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13530 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13516 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13531 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13517 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13532 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13518 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13533 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13519 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13534 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13520 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13535 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13521 } 13536 }
13522 13537
13523 } } // namespace v8::internal 13538 } } // namespace v8::internal
OLDNEW
« 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