OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1755 Object::ToString(isolate, description)); | 1755 Object::ToString(isolate, description)); |
1756 result->set_name(*description); | 1756 result->set_name(*description); |
1757 } | 1757 } |
1758 return *result; | 1758 return *result; |
1759 } | 1759 } |
1760 | 1760 |
1761 | 1761 |
1762 // ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Construct]] case. | 1762 // ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Construct]] case. |
1763 BUILTIN(SymbolConstructor_ConstructStub) { | 1763 BUILTIN(SymbolConstructor_ConstructStub) { |
1764 HandleScope scope(isolate); | 1764 HandleScope scope(isolate); |
| 1765 // The ConstructStub is executed in the context of the caller, so we need |
| 1766 // to enter the callee context first before raising an exception. |
| 1767 isolate->set_context(args.called_function()->context()); |
1765 THROW_NEW_ERROR_RETURN_FAILURE( | 1768 THROW_NEW_ERROR_RETURN_FAILURE( |
1766 isolate, NewTypeError(MessageTemplate::kNotConstructor, | 1769 isolate, NewTypeError(MessageTemplate::kNotConstructor, |
1767 isolate->factory()->Symbol_string())); | 1770 isolate->factory()->Symbol_string())); |
1768 } | 1771 } |
1769 | 1772 |
1770 | 1773 |
1771 // ----------------------------------------------------------------------------- | 1774 // ----------------------------------------------------------------------------- |
1772 // Throwers for restricted function properties and strict arguments object | 1775 // Throwers for restricted function properties and strict arguments object |
1773 // properties | 1776 // properties |
1774 | 1777 |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 2404 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
2402 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 2405 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
2403 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 2406 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
2404 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 2407 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
2405 #undef DEFINE_BUILTIN_ACCESSOR_C | 2408 #undef DEFINE_BUILTIN_ACCESSOR_C |
2406 #undef DEFINE_BUILTIN_ACCESSOR_A | 2409 #undef DEFINE_BUILTIN_ACCESSOR_A |
2407 | 2410 |
2408 | 2411 |
2409 } // namespace internal | 2412 } // namespace internal |
2410 } // namespace v8 | 2413 } // namespace v8 |
OLD | NEW |