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

Unified Diff: src/objects.cc

Issue 2764343004: [regexp] Named capture support for callable replacements (Closed)
Patch Set: Created 3 years, 9 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index a63255a931090e60b01e5caf48e2747cdc9a7c97..2481e350e7dadb0dc577181862fc94a768d3118e 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -6572,6 +6572,18 @@ Maybe<bool> JSReceiver::ValidateAndApplyPropertyDescriptor(
return Just(true);
}
+// static
+Maybe<bool> JSReceiver::CreateDataProperty(Handle<JSReceiver> holder,
Yang 2017/03/23 14:58:22 Does JSObject::AddProperty not fit the purpose? We
jgruber 2017/03/24 14:06:46 Good point, CreateDataProperty ends up calling tha
+ Handle<Object> key,
+ Handle<Object> value,
+ ShouldThrow should_throw) {
+ Isolate* isolate = holder->GetIsolate();
+ bool success;
+ LookupIterator it = LookupIterator::PropertyOrElement(
+ isolate, holder, key, &success, LookupIterator::OWN);
+ if (!success) return Nothing<bool>();
+ return JSReceiver::CreateDataProperty(&it, value, should_throw);
+}
// static
Maybe<bool> JSReceiver::CreateDataProperty(LookupIterator* it,
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | src/runtime/runtime-regexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698