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 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 %CheckIsBootstrapping(); | 7 %CheckIsBootstrapping(); |
8 | 8 |
9 // ---------------------------------------------------------------------------- | 9 // ---------------------------------------------------------------------------- |
10 // Imports | 10 // Imports |
11 | 11 |
12 var FLAG_harmony_tostring; | 12 var FLAG_harmony_tostring; |
13 var GlobalArray = global.Array; | 13 var GlobalArray = global.Array; |
14 var GlobalBoolean = global.Boolean; | 14 var GlobalBoolean = global.Boolean; |
15 var GlobalFunction = global.Function; | 15 var GlobalFunction = global.Function; |
16 var GlobalNumber = global.Number; | 16 var GlobalNumber = global.Number; |
17 var GlobalObject = global.Object; | 17 var GlobalObject = global.Object; |
18 var InternalArray = utils.InternalArray; | 18 var InternalArray = utils.InternalArray; |
19 var iteratorSymbol = utils.ImportNow("iterator_symbol"); | 19 var iteratorSymbol = utils.ImportNow("iterator_symbol"); |
20 var MakeRangeError; | 20 var MakeRangeError; |
21 var MakeSyntaxError; | 21 var MakeSyntaxError; |
22 var MakeTypeError; | 22 var MakeTypeError; |
23 var MathAbs; | 23 var MathAbs; |
24 var NaN = %GetRootNaN(); | 24 var NaN = %GetRootNaN(); |
25 var ObserveBeginPerformSplice; | 25 var ObserveBeginPerformSplice; |
26 var ObserveEndPerformSplice; | 26 var ObserveEndPerformSplice; |
27 var ObserveEnqueueSpliceRecord; | 27 var ObserveEnqueueSpliceRecord; |
28 var ProxyDelegateCallAndConstruct; | |
29 var ProxyDerivedHasOwnTrap; | |
30 var SameValue = utils.ImportNow("SameValue"); | 28 var SameValue = utils.ImportNow("SameValue"); |
31 var StringIndexOf; | 29 var StringIndexOf; |
32 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | 30 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
33 | 31 |
34 utils.Import(function(from) { | 32 utils.Import(function(from) { |
35 MakeRangeError = from.MakeRangeError; | 33 MakeRangeError = from.MakeRangeError; |
36 MakeSyntaxError = from.MakeSyntaxError; | 34 MakeSyntaxError = from.MakeSyntaxError; |
37 MakeTypeError = from.MakeTypeError; | 35 MakeTypeError = from.MakeTypeError; |
38 MathAbs = from.MathAbs; | 36 MathAbs = from.MathAbs; |
39 ObserveBeginPerformSplice = from.ObserveBeginPerformSplice; | 37 ObserveBeginPerformSplice = from.ObserveBeginPerformSplice; |
40 ObserveEndPerformSplice = from.ObserveEndPerformSplice; | 38 ObserveEndPerformSplice = from.ObserveEndPerformSplice; |
41 ObserveEnqueueSpliceRecord = from.ObserveEnqueueSpliceRecord; | 39 ObserveEnqueueSpliceRecord = from.ObserveEnqueueSpliceRecord; |
42 StringIndexOf = from.StringIndexOf; | 40 StringIndexOf = from.StringIndexOf; |
43 }); | 41 }); |
44 | 42 |
45 utils.ImportFromExperimental(function(from) { | 43 utils.ImportFromExperimental(function(from) { |
46 FLAG_harmony_tostring = from.FLAG_harmony_tostring; | 44 FLAG_harmony_tostring = from.FLAG_harmony_tostring; |
47 ProxyDelegateCallAndConstruct = from.ProxyDelegateCallAndConstruct; | |
48 ProxyDerivedHasOwnTrap = from.ProxyDerivedHasOwnTrap; | |
49 }); | 45 }); |
50 | 46 |
51 // ---------------------------------------------------------------------------- | 47 // ---------------------------------------------------------------------------- |
52 | 48 |
53 | 49 |
54 // ECMA 262 - 15.1.4 | 50 // ECMA 262 - 15.1.4 |
55 function GlobalIsNaN(number) { | 51 function GlobalIsNaN(number) { |
56 number = TO_NUMBER(number); | 52 number = TO_NUMBER(number); |
57 return NUMBER_IS_NAN(number); | 53 return NUMBER_IS_NAN(number); |
58 } | 54 } |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 throw MakeTypeError(kProxyHandlerTrapMissing, handler, name); | 503 throw MakeTypeError(kProxyHandlerTrapMissing, handler, name); |
508 } | 504 } |
509 trap = defaultTrap; | 505 trap = defaultTrap; |
510 } else if (!IS_CALLABLE(trap)) { | 506 } else if (!IS_CALLABLE(trap)) { |
511 throw MakeTypeError(kProxyHandlerTrapMustBeCallable, handler, name); | 507 throw MakeTypeError(kProxyHandlerTrapMustBeCallable, handler, name); |
512 } | 508 } |
513 return trap; | 509 return trap; |
514 } | 510 } |
515 | 511 |
516 | 512 |
517 function CallTrap0(handler, name, defaultTrap) { | |
518 return %_Call(GetTrap(handler, name, defaultTrap), handler); | |
519 } | |
520 | |
521 | |
522 function CallTrap1(handler, name, defaultTrap, x) { | 513 function CallTrap1(handler, name, defaultTrap, x) { |
523 return %_Call(GetTrap(handler, name, defaultTrap), handler, x); | 514 return %_Call(GetTrap(handler, name, defaultTrap), handler, x); |
524 } | 515 } |
525 | 516 |
526 | 517 |
527 function CallTrap2(handler, name, defaultTrap, x, y) { | 518 function CallTrap2(handler, name, defaultTrap, x, y) { |
528 return %_Call(GetTrap(handler, name, defaultTrap), handler, x, y); | 519 return %_Call(GetTrap(handler, name, defaultTrap), handler, x, y); |
529 } | 520 } |
530 | 521 |
531 | 522 |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 to.ObjectHasOwnProperty = ObjectHasOwnProperty; | 1598 to.ObjectHasOwnProperty = ObjectHasOwnProperty; |
1608 to.ObjectIsFrozen = ObjectIsFrozen; | 1599 to.ObjectIsFrozen = ObjectIsFrozen; |
1609 to.ObjectIsSealed = ObjectIsSealed; | 1600 to.ObjectIsSealed = ObjectIsSealed; |
1610 to.ObjectToString = ObjectToString; | 1601 to.ObjectToString = ObjectToString; |
1611 }); | 1602 }); |
1612 | 1603 |
1613 %InstallToContext([ | 1604 %InstallToContext([ |
1614 "global_eval_fun", GlobalEval, | 1605 "global_eval_fun", GlobalEval, |
1615 "object_value_of", ObjectValueOf, | 1606 "object_value_of", ObjectValueOf, |
1616 "object_to_string", ObjectToString, | 1607 "object_to_string", ObjectToString, |
1617 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, | |
1618 "to_complete_property_descriptor", ToCompletePropertyDescriptor, | |
1619 ]); | 1608 ]); |
1620 | 1609 |
1621 }) | 1610 }) |
OLD | NEW |