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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 6554 matching lines...) Expand 10 before | Expand all | Expand 10 after
6565 MaybeHandle<Object> result = 6565 MaybeHandle<Object> result =
6566 JSObject::DefineAccessor(it, getter, setter, attrs); 6566 JSObject::DefineAccessor(it, getter, setter, attrs);
6567 if (result.is_null()) return Nothing<bool>(); 6567 if (result.is_null()) return Nothing<bool>();
6568 } 6568 }
6569 } 6569 }
6570 6570
6571 // 11. Return true. 6571 // 11. Return true.
6572 return Just(true); 6572 return Just(true);
6573 } 6573 }
6574 6574
6575 // static
6576 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
6577 Handle<Object> key,
6578 Handle<Object> value,
6579 ShouldThrow should_throw) {
6580 Isolate* isolate = holder->GetIsolate();
6581 bool success;
6582 LookupIterator it = LookupIterator::PropertyOrElement(
6583 isolate, holder, key, &success, LookupIterator::OWN);
6584 if (!success) return Nothing<bool>();
6585 return JSReceiver::CreateDataProperty(&it, value, should_throw);
6586 }
6575 6587
6576 // static 6588 // static
6577 Maybe<bool> JSReceiver::CreateDataProperty(LookupIterator* it, 6589 Maybe<bool> JSReceiver::CreateDataProperty(LookupIterator* it,
6578 Handle<Object> value, 6590 Handle<Object> value,
6579 ShouldThrow should_throw) { 6591 ShouldThrow should_throw) {
6580 DCHECK(!it->check_prototype_chain()); 6592 DCHECK(!it->check_prototype_chain());
6581 Handle<JSReceiver> receiver = Handle<JSReceiver>::cast(it->GetReceiver()); 6593 Handle<JSReceiver> receiver = Handle<JSReceiver>::cast(it->GetReceiver());
6582 Isolate* isolate = receiver->GetIsolate(); 6594 Isolate* isolate = receiver->GetIsolate();
6583 6595
6584 if (receiver->IsJSObject()) { 6596 if (receiver->IsJSObject()) {
(...skipping 13711 matching lines...) Expand 10 before | Expand all | Expand 10 after
20296 // depend on this. 20308 // depend on this.
20297 return DICTIONARY_ELEMENTS; 20309 return DICTIONARY_ELEMENTS;
20298 } 20310 }
20299 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20311 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20300 return kind; 20312 return kind;
20301 } 20313 }
20302 } 20314 }
20303 20315
20304 } // namespace internal 20316 } // namespace internal
20305 } // namespace v8 20317 } // namespace v8
OLDNEW
« 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