Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 if (constructor->map()->is_strong()) { | 126 if (constructor->map()->is_strong()) { |
| 127 map->set_is_strong(); | 127 map->set_is_strong(); |
| 128 if (super_class->IsNull()) { | 128 if (super_class->IsNull()) { |
| 129 // Strong class is not permitted to extend null. | 129 // Strong class is not permitted to extend null. |
| 130 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kStrongExtendNull), | 130 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kStrongExtendNull), |
| 131 Object); | 131 Object); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 Map::SetPrototype(map, prototype_parent); | 134 Map::SetPrototype(map, prototype_parent); |
| 135 map->SetConstructor(*constructor); | 135 map->SetConstructor(*constructor); |
| 136 map->set_is_prototype_map(true); | |
|
adamk
2015/10/22 12:01:32
Is this related to your change?
Toon Verwaest
2015/10/22 13:50:56
No, I'll remove for now.
| |
| 136 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); | 137 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); |
| 137 | 138 |
| 138 Handle<String> name_string = name->IsString() | 139 Handle<String> name_string = name->IsString() |
| 139 ? Handle<String>::cast(name) | 140 ? Handle<String>::cast(name) |
| 140 : isolate->factory()->empty_string(); | 141 : isolate->factory()->empty_string(); |
| 141 constructor->shared()->set_name(*name_string); | 142 constructor->shared()->set_name(*name_string); |
| 142 | 143 |
| 143 if (!super_class->IsTheHole()) { | 144 if (!super_class->IsTheHole()) { |
| 144 Handle<Code> stub(isolate->builtins()->JSConstructStubForDerived()); | 145 Handle<Code> stub(isolate->builtins()->JSConstructStubForDerived()); |
| 145 constructor->shared()->set_construct_stub(*stub); | 146 constructor->shared()->set_construct_stub(*stub); |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 515 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 515 isolate, result, | 516 isolate, result, |
| 516 Execution::New(isolate, super_constructor, original_constructor, | 517 Execution::New(isolate, super_constructor, original_constructor, |
| 517 argument_count, arguments.get())); | 518 argument_count, arguments.get())); |
| 518 | 519 |
| 519 return *result; | 520 return *result; |
| 520 } | 521 } |
| 521 | 522 |
| 522 } // namespace internal | 523 } // namespace internal |
| 523 } // namespace v8 | 524 } // namespace v8 |
| OLD | NEW |