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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 Object); | 155 Object); |
156 | 156 |
157 // TODO(arv): Only do this conditionally. | 157 // TODO(arv): Only do this conditionally. |
158 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol()); | 158 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol()); |
159 RETURN_ON_EXCEPTION( | 159 RETURN_ON_EXCEPTION( |
160 isolate, JSObject::SetOwnPropertyIgnoreAttributes( | 160 isolate, JSObject::SetOwnPropertyIgnoreAttributes( |
161 constructor, home_object_symbol, prototype, DONT_ENUM), | 161 constructor, home_object_symbol, prototype, DONT_ENUM), |
162 Object); | 162 Object); |
163 | 163 |
164 if (!constructor_parent.is_null()) { | 164 if (!constructor_parent.is_null()) { |
165 RETURN_ON_EXCEPTION( | 165 MAYBE_RETURN_NULL(JSObject::SetPrototype(constructor, constructor_parent, |
166 isolate, JSObject::SetPrototype(constructor, constructor_parent, false), | 166 false, THROW_ON_ERROR)); |
167 Object); | |
168 } | 167 } |
169 | 168 |
170 JSObject::AddProperty(prototype, isolate->factory()->constructor_string(), | 169 JSObject::AddProperty(prototype, isolate->factory()->constructor_string(), |
171 constructor, DONT_ENUM); | 170 constructor, DONT_ENUM); |
172 | 171 |
173 // Install private properties that are used to construct the FunctionToString. | 172 // Install private properties that are used to construct the FunctionToString. |
174 RETURN_ON_EXCEPTION( | 173 RETURN_ON_EXCEPTION( |
175 isolate, | 174 isolate, |
176 Object::SetProperty( | 175 Object::SetProperty( |
177 constructor, isolate->factory()->class_start_position_symbol(), | 176 constructor, isolate->factory()->class_start_position_symbol(), |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 513 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
515 isolate, result, | 514 isolate, result, |
516 Execution::New(isolate, super_constructor, original_constructor, | 515 Execution::New(isolate, super_constructor, original_constructor, |
517 argument_count, arguments.get())); | 516 argument_count, arguments.get())); |
518 | 517 |
519 return *result; | 518 return *result; |
520 } | 519 } |
521 | 520 |
522 } // namespace internal | 521 } // namespace internal |
523 } // namespace v8 | 522 } // namespace v8 |
OLD | NEW |