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

Unified Diff: src/api.cc

Issue 1172683003: Use the LookupIterator for SetElement and friends (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 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 | « src/api.h ('k') | src/array.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 7c29a344f1faa45140d865afe047c905fb742590..b8812800081d1b36ea84b5871c2a80a8d870bb93 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3485,8 +3485,8 @@ Maybe<bool> v8::Object::Set(v8::Local<v8::Context> context, uint32_t index,
PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Set()", bool);
auto self = Utils::OpenHandle(this);
auto value_obj = Utils::OpenHandle(*value);
- has_pending_exception = i::JSObject::SetElement(
- self, index, value_obj, NONE, i::SLOPPY).is_null();
+ has_pending_exception =
+ i::JSReceiver::SetElement(self, index, value_obj, i::SLOPPY).is_null();
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
return Just(true);
}
@@ -3533,18 +3533,7 @@ Maybe<bool> v8::Object::CreateDataProperty(v8::Local<v8::Context> context,
it.Next();
}
- if (it.state() == i::LookupIterator::DATA ||
- it.state() == i::LookupIterator::ACCESSOR) {
- if (!it.IsConfigurable()) return Just(false);
-
- if (it.state() == i::LookupIterator::ACCESSOR) {
- has_pending_exception = i::JSObject::SetOwnPropertyIgnoreAttributes(
- self, key_obj, value_obj, NONE,
- i::JSObject::DONT_FORCE_FIELD).is_null();
- RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
- return Just(true);
- }
- }
+ if (it.IsFound() && !it.IsConfigurable()) return Just(false);
has_pending_exception = i::Runtime::DefineObjectProperty(
self, key_obj, value_obj, NONE).is_null();
« no previous file with comments | « src/api.h ('k') | src/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698