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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 RETURN_RESULT_OR_FAILURE( | 396 RETURN_RESULT_OR_FAILURE( |
| 397 isolate, | 397 isolate, |
| 398 StoreKeyedToSuper(isolate, home_object, receiver, key, value, SLOPPY)); | 398 StoreKeyedToSuper(isolate, home_object, receiver, key, value, SLOPPY)); |
| 399 } | 399 } |
| 400 | 400 |
| 401 | 401 |
| 402 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { | 402 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { |
| 403 SealHandleScope shs(isolate); | 403 SealHandleScope shs(isolate); |
| 404 DCHECK_EQ(1, args.length()); | 404 DCHECK_EQ(1, args.length()); |
| 405 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); | 405 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); |
| 406 return active_function->map()->prototype(); | 406 Object* prototype = active_function->map()->prototype(); |
| 407 if (!prototype->IsConstructor()) { | |
| 408 return Runtime_ThrowConstructedNonConstructable(1, &prototype, isolate); | |
|
Benedikt Meurer
2016/11/23 04:51:00
Please don't call other runtime functions this way
| |
| 409 } | |
| 410 return prototype; | |
| 407 } | 411 } |
| 408 | 412 |
| 409 } // namespace internal | 413 } // namespace internal |
| 410 } // namespace v8 | 414 } // namespace v8 |
| OLD | NEW |