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

Side by Side Diff: src/runtime/runtime-classes.cc

Issue 1358423002: [es6] Introduce spec compliant IsConstructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix stupid fuzzer failure (constructor bit set on sloppy/strict arguments). Fix MIPS/MIPS64 typos, … Created 5 years, 2 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
« no previous file with comments | « src/preparser.cc ('k') | src/runtime/runtime-function.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <limits> 8 #include <limits>
9 9
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 Handle<JSFunction> constructor, 98 Handle<JSFunction> constructor,
99 int start_position, int end_position) { 99 int start_position, int end_position) {
100 Handle<Object> prototype_parent; 100 Handle<Object> prototype_parent;
101 Handle<Object> constructor_parent; 101 Handle<Object> constructor_parent;
102 102
103 if (super_class->IsTheHole()) { 103 if (super_class->IsTheHole()) {
104 prototype_parent = isolate->initial_object_prototype(); 104 prototype_parent = isolate->initial_object_prototype();
105 } else { 105 } else {
106 if (super_class->IsNull()) { 106 if (super_class->IsNull()) {
107 prototype_parent = isolate->factory()->null_value(); 107 prototype_parent = isolate->factory()->null_value();
108 } else if (super_class->IsJSFunction()) { // TODO(bmeurer): IsConstructor. 108 } else if (super_class->IsConstructor()) {
109 if (Handle<JSFunction>::cast(super_class)->shared()->is_generator()) { 109 if (super_class->IsJSFunction() &&
110 Handle<JSFunction>::cast(super_class)->shared()->is_generator()) {
110 THROW_NEW_ERROR( 111 THROW_NEW_ERROR(
111 isolate, 112 isolate,
112 NewTypeError(MessageTemplate::kExtendsValueGenerator, super_class), 113 NewTypeError(MessageTemplate::kExtendsValueGenerator, super_class),
113 Object); 114 Object);
114 } 115 }
115 ASSIGN_RETURN_ON_EXCEPTION( 116 ASSIGN_RETURN_ON_EXCEPTION(
116 isolate, prototype_parent, 117 isolate, prototype_parent,
117 Runtime::GetObjectProperty(isolate, super_class, 118 Runtime::GetObjectProperty(isolate, super_class,
118 isolate->factory()->prototype_string(), 119 isolate->factory()->prototype_string(),
119 SLOPPY), 120 SLOPPY),
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 523 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
523 isolate, result, 524 isolate, result,
524 Execution::New(isolate, super_constructor, original_constructor, 525 Execution::New(isolate, super_constructor, original_constructor,
525 argument_count, arguments.get())); 526 argument_count, arguments.get()));
526 527
527 return *result; 528 return *result;
528 } 529 }
529 530
530 } // namespace internal 531 } // namespace internal
531 } // namespace v8 532 } // namespace v8
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698