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

Side by Side Diff: src/api-natives.cc

Issue 2449163004: Allow immutable prototype templates to inherit (Closed)
Patch Set: Fix up test Created 4 years, 1 month 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
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/api-natives.h" 5 #include "src/api-natives.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 #include "src/lookup.h" 9 #include "src/lookup.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 InstantiateFunction( 430 InstantiateFunction(
431 isolate, handle(FunctionTemplateInfo::cast(parent), isolate)), 431 isolate, handle(FunctionTemplateInfo::cast(parent), isolate)),
432 JSFunction); 432 JSFunction);
433 // TODO(dcarney): decide what to do here. 433 // TODO(dcarney): decide what to do here.
434 Handle<Object> parent_prototype; 434 Handle<Object> parent_prototype;
435 ASSIGN_RETURN_ON_EXCEPTION( 435 ASSIGN_RETURN_ON_EXCEPTION(
436 isolate, parent_prototype, 436 isolate, parent_prototype,
437 JSObject::GetProperty(parent_instance, 437 JSObject::GetProperty(parent_instance,
438 isolate->factory()->prototype_string()), 438 isolate->factory()->prototype_string()),
439 JSFunction); 439 JSFunction);
440 MAYBE_RETURN(JSObject::SetPrototype(prototype, parent_prototype, false, 440 JSObject::ForceSetPrototype(prototype, parent_prototype);
441 Object::THROW_ON_ERROR),
442 MaybeHandle<JSFunction>());
443 } 441 }
444 } 442 }
445 Handle<JSFunction> function = ApiNatives::CreateApiFunction( 443 Handle<JSFunction> function = ApiNatives::CreateApiFunction(
446 isolate, data, prototype, ApiNatives::JavaScriptObjectType); 444 isolate, data, prototype, ApiNatives::JavaScriptObjectType);
447 if (!name.is_null() && name->IsString()) { 445 if (!name.is_null() && name->IsString()) {
448 function->shared()->set_name(*name); 446 function->shared()->set_name(*name);
449 } 447 }
450 if (serial_number) { 448 if (serial_number) {
451 // Cache the function. 449 // Cache the function.
452 CacheTemplateInstantiation(isolate, serial_number, function); 450 CacheTemplateInstantiation(isolate, serial_number, function);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 if (!obj->instance_call_handler()->IsUndefined(isolate)) { 674 if (!obj->instance_call_handler()->IsUndefined(isolate)) {
677 map->set_is_callable(); 675 map->set_is_callable();
678 map->set_is_constructor(true); 676 map->set_is_constructor(true);
679 } 677 }
680 678
681 return result; 679 return result;
682 } 680 }
683 681
684 } // namespace internal 682 } // namespace internal
685 } // namespace v8 683 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698