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

Unified Diff: src/api.cc

Issue 351853005: Split SetProperty(...attributes, strictmode) into AddProperty(...attributes) and SetProperty(...… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | src/apinatives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index fc22929fd0ab392744025cea88b1dfbdd09f2330..8bab7d2c789ce120a4c52153635304f13418d384 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3030,6 +3030,9 @@ uint32_t Value::Uint32Value() const {
}
+// TODO(verwaest): Remove the attribs argument, since it doesn't make sense for
+// existing properties. Use ForceSet instead to define or redefine properties
+// with specific attributes.
bool v8::Object::Set(v8::Handle<Value> key, v8::Handle<Value> value,
v8::PropertyAttribute attribs) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
@@ -3041,12 +3044,8 @@ bool v8::Object::Set(v8::Handle<Value> key, v8::Handle<Value> value,
i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
EXCEPTION_PREAMBLE(isolate);
has_pending_exception = i::Runtime::SetObjectProperty(
- isolate,
- self,
- key_obj,
- value_obj,
- static_cast<PropertyAttributes>(attribs),
- i::SLOPPY).is_null();
+ isolate, self, key_obj, value_obj, i::SLOPPY,
+ static_cast<PropertyAttributes>(attribs)).is_null();
EXCEPTION_BAILOUT_CHECK(isolate, false);
return true;
}
@@ -3078,7 +3077,7 @@ bool v8::Object::ForceSet(v8::Handle<Value> key,
i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
EXCEPTION_PREAMBLE(isolate);
- has_pending_exception = i::Runtime::ForceSetObjectProperty(
+ has_pending_exception = i::Runtime::DefineObjectProperty(
self,
key_obj,
value_obj,
« no previous file with comments | « no previous file | src/apinatives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698