Fix symbol-named function template properties in the API
Thanks to Yutaka Hirano <yhirano@chromium.org> for finding the bug and providing the test case. R=rossberg@chromium.org BUG= Review URL: https://codereview.chromium.org/496663002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
c360d8d114
commit
558a05bfcf
@ -72,7 +72,7 @@ function InstantiateFunction(data, name) {
|
||||
}
|
||||
}
|
||||
var fun = %CreateApiFunction(data, prototype);
|
||||
if (name) %FunctionSetName(fun, name);
|
||||
if (IS_STRING(name)) %FunctionSetName(fun, name);
|
||||
var doNotCache = flags & (1 << kDoNotCacheBit);
|
||||
if (!doNotCache) cache[serialNumber] = fun;
|
||||
ConfigureTemplateInstance(fun, data);
|
||||
|
@ -2886,6 +2886,20 @@ THREADED_TEST(SymbolProperties) {
|
||||
}
|
||||
|
||||
|
||||
THREADED_TEST(SymbolTemplateProperties) {
|
||||
LocalContext env;
|
||||
v8::Isolate* isolate = env->GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
v8::Local<v8::FunctionTemplate> foo = v8::FunctionTemplate::New(isolate);
|
||||
v8::Local<v8::Name> name = v8::Symbol::New(isolate);
|
||||
CHECK(!name.IsEmpty());
|
||||
foo->PrototypeTemplate()->Set(name, v8::FunctionTemplate::New(isolate));
|
||||
v8::Local<v8::Object> new_instance = foo->InstanceTemplate()->NewInstance();
|
||||
CHECK(!new_instance.IsEmpty());
|
||||
CHECK(new_instance->Has(name));
|
||||
}
|
||||
|
||||
|
||||
THREADED_TEST(PrivateProperties) {
|
||||
LocalContext env;
|
||||
v8::Isolate* isolate = env->GetIsolate();
|
||||
|
Loading…
Reference in New Issue
Block a user