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

Unified Diff: src/accessors.cc

Issue 960343002: ES6: Make function name configurable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Relax assert Created 5 years, 10 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/bootstrapper.cc » ('j') | src/lookup.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 052108a9b065feba47aa9ae907d55a9f33d092ab..1db09bb453f543b2ad466e97e0c22781fe71f583 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -1135,8 +1135,20 @@ void Accessors::FunctionNameSetter(
v8::Local<v8::Name> name,
v8::Local<v8::Value> val,
const v8::PropertyCallbackInfo<void>& info) {
- // Function name is non writable, non configurable.
- UNREACHABLE();
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
+ HandleScope scope(isolate);
+ Handle<Object> value = Utils::OpenHandle(*val);
+
+ if (SetPropertyOnInstanceIfInherited(isolate, info, name, value)) return;
+
+ Handle<JSObject> object = Utils::OpenHandle(*info.This());
+ LookupIterator it(object, Utils::OpenHandle(*name));
+ CHECK_EQ(LookupIterator::ACCESSOR, it.state());
+ DCHECK(it.HolderIsReceiverOrHiddenPrototype());
+ it.PrepareForDataProperty(value);
+ if (Object::SetDataProperty(&it, value).is_null()) {
+ isolate->OptionalRescheduleException(false);
+ }
adamk 2015/02/26 23:31:51 You're going to want an EnqueueChangeRecord call h
Toon Verwaest 2015/02/27 12:44:10 Unlike Function::SetPrototype, SetDataProperty alr
}
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | src/lookup.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698