| 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <limits> | 6 #include <limits> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // TODO(arv): Should be IsConstructor. | 130 // TODO(arv): Should be IsConstructor. |
| 131 THROW_NEW_ERROR( | 131 THROW_NEW_ERROR( |
| 132 isolate, | 132 isolate, |
| 133 NewTypeError(MessageTemplate::kExtendsValueNotFunction, super_class), | 133 NewTypeError(MessageTemplate::kExtendsValueNotFunction, super_class), |
| 134 Object); | 134 Object); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 Handle<Map> map = | 138 Handle<Map> map = |
| 139 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 139 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
| 140 if (constructor->map()->is_strong()) { |
| 141 map->set_is_strong(); |
| 142 } |
| 140 Map::SetPrototype(map, prototype_parent); | 143 Map::SetPrototype(map, prototype_parent); |
| 141 map->SetConstructor(*constructor); | 144 map->SetConstructor(*constructor); |
| 142 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); | 145 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); |
| 143 | 146 |
| 144 Handle<String> name_string = name->IsString() | 147 Handle<String> name_string = name->IsString() |
| 145 ? Handle<String>::cast(name) | 148 ? Handle<String>::cast(name) |
| 146 : isolate->factory()->empty_string(); | 149 : isolate->factory()->empty_string(); |
| 147 constructor->shared()->set_name(*name_string); | 150 constructor->shared()->set_name(*name_string); |
| 148 | 151 |
| 149 if (!super_class->IsTheHole()) { | 152 if (!super_class->IsTheHole()) { |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 Handle<Object> result; | 593 Handle<Object> result; |
| 591 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 594 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 592 isolate, result, | 595 isolate, result, |
| 593 Execution::Call(isolate, reflect, isolate->factory()->undefined_value(), | 596 Execution::Call(isolate, reflect, isolate->factory()->undefined_value(), |
| 594 arraysize(argv), argv)); | 597 arraysize(argv), argv)); |
| 595 | 598 |
| 596 return *result; | 599 return *result; |
| 597 } | 600 } |
| 598 } // namespace internal | 601 } // namespace internal |
| 599 } // namespace v8 | 602 } // namespace v8 |
| OLD | NEW |