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

Unified Diff: src/runtime.cc

Issue 572005: Added extra tests to the DefineOrRedefineAccessorProperty and ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 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 | « no previous file | test/mjsunit/object-define-property.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 3794)
+++ src/runtime.cc (working copy)
@@ -2898,7 +2898,7 @@
CONVERT_CHECKED(Smi, flag_attr, args[4]);
int unchecked = flag_attr->value();
RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0);
-
+ RUNTIME_ASSERT(!obj->IsNull());
LookupResult result;
obj->LocalLookupRealNamedProperty(name, &result);
@@ -2917,18 +2917,16 @@
static Object* Runtime_DefineOrRedefineDataProperty(Arguments args) {
ASSERT(args.length() == 4);
HandleScope scope;
- Handle<Object> obj = args.at<Object>(0);
- Handle<Object> name = args.at<Object>(1);
+ CONVERT_ARG_CHECKED(JSObject, js_object, 0);
+ CONVERT_ARG_CHECKED(String, name, 1);
Handle<Object> obj_value = args.at<Object>(2);
- Handle<JSObject> js_object = Handle<JSObject>::cast(obj);
- Handle<String> key_string = Handle<String>::cast(name);
-
+
CONVERT_CHECKED(Smi, flag, args[3]);
int unchecked = flag->value();
RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0);
LookupResult result;
- js_object->LocalLookupRealNamedProperty(*key_string, &result);
+ js_object->LocalLookupRealNamedProperty(*name, &result);
PropertyAttributes attr = static_cast<PropertyAttributes>(unchecked);
@@ -2942,7 +2940,7 @@
PropertyDetails details = PropertyDetails(attr, NORMAL);
// New attributes - normalize to avoid writing to instance descriptor
js_object->NormalizeProperties(KEEP_INOBJECT_PROPERTIES, 0);
- return js_object->SetNormalizedProperty(*key_string, *obj_value, details);
+ return js_object->SetNormalizedProperty(*name, *obj_value, details);
}
return Runtime::SetObjectProperty(js_object, name, obj_value, attr);
« no previous file with comments | « no previous file | test/mjsunit/object-define-property.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698