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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 } | 771 } |
772 } | 772 } |
773 | 773 |
774 DCHECK(j == result_len); | 774 DCHECK(j == result_len); |
775 | 775 |
776 return *result_array; | 776 return *result_array; |
777 } | 777 } |
778 | 778 |
779 | 779 |
780 // ----------------------------------------------------------------------------- | 780 // ----------------------------------------------------------------------------- |
| 781 // |
| 782 |
| 783 |
| 784 // 20.3.4.45 Date.prototype [ @@toPrimitive ] ( hint ) |
| 785 BUILTIN(DateToPrimitive) { |
| 786 HandleScope scope(isolate); |
| 787 DCHECK_EQ(2, args.length()); |
| 788 if (!args.receiver()->IsJSReceiver()) { |
| 789 THROW_NEW_ERROR_RETURN_FAILURE( |
| 790 isolate, NewTypeError(MessageTemplate::kIncompatibleMethodReceiver, |
| 791 isolate->factory()->NewStringFromAsciiChecked( |
| 792 "Date.prototype [ @@toPrimitive ]"), |
| 793 args.receiver())); |
| 794 } |
| 795 Handle<JSReceiver> receiver = args.at<JSReceiver>(0); |
| 796 Handle<Object> hint = args.at<Object>(1); |
| 797 Handle<Object> result; |
| 798 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 799 JSDate::ToPrimitive(receiver, hint)); |
| 800 return *result; |
| 801 } |
| 802 |
| 803 |
| 804 // ----------------------------------------------------------------------------- |
781 // Throwers for restricted function properties and strict arguments object | 805 // Throwers for restricted function properties and strict arguments object |
782 // properties | 806 // properties |
783 | 807 |
784 | 808 |
785 BUILTIN(RestrictedFunctionPropertiesThrower) { | 809 BUILTIN(RestrictedFunctionPropertiesThrower) { |
786 HandleScope scope(isolate); | 810 HandleScope scope(isolate); |
787 THROW_NEW_ERROR_RETURN_FAILURE( | 811 THROW_NEW_ERROR_RETURN_FAILURE( |
788 isolate, NewTypeError(MessageTemplate::kRestrictedFunctionProperties)); | 812 isolate, NewTypeError(MessageTemplate::kRestrictedFunctionProperties)); |
789 } | 813 } |
790 | 814 |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1402 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1379 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1403 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1380 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1404 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
1381 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1405 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1382 #undef DEFINE_BUILTIN_ACCESSOR_C | 1406 #undef DEFINE_BUILTIN_ACCESSOR_C |
1383 #undef DEFINE_BUILTIN_ACCESSOR_A | 1407 #undef DEFINE_BUILTIN_ACCESSOR_A |
1384 | 1408 |
1385 | 1409 |
1386 } // namespace internal | 1410 } // namespace internal |
1387 } // namespace v8 | 1411 } // namespace v8 |
OLD | NEW |