OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 // ECMAScript 402 API implementation. | 5 // ECMAScript 402 API implementation. |
6 | 6 |
7 /** | 7 /** |
8 * Intl object is a single object that has some named properties, | 8 * Intl object is a single object that has some named properties, |
9 * all of which are constructors. | 9 * all of which are constructors. |
10 */ | 10 */ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 // property on each JSFunction instance created here, rather | 69 // property on each JSFunction instance created here, rather |
70 // than (as utils.InstallGetter would) on the SharedFunctionInfo | 70 // than (as utils.InstallGetter would) on the SharedFunctionInfo |
71 // associated with all functions returned from AddBoundMethod. | 71 // associated with all functions returned from AddBoundMethod. |
72 var getter = ANONYMOUS_FUNCTION(function() { | 72 var getter = ANONYMOUS_FUNCTION(function() { |
73 if (!%IsInitializedIntlObjectOfType(this, type)) { | 73 if (!%IsInitializedIntlObjectOfType(this, type)) { |
74 throw %make_type_error(kMethodCalledOnWrongObject, methodName); | 74 throw %make_type_error(kMethodCalledOnWrongObject, methodName); |
75 } | 75 } |
76 if (IS_UNDEFINED(this[internalName])) { | 76 if (IS_UNDEFINED(this[internalName])) { |
77 var boundMethod; | 77 var boundMethod; |
78 if (IS_UNDEFINED(length) || length === 2) { | 78 if (IS_UNDEFINED(length) || length === 2) { |
79 boundMethod = ANONYMOUS_FUNCTION((x, y) => implementation(this, x, y)); | 79 boundMethod = ANONYMOUS_FUNCTION((fst, snd) => implementation(this, fst, snd)); |
Yang
2016/10/12 04:56:55
can we keep the 80-char limit?
jgruber
2016/10/12 06:55:08
Done.
| |
80 } else if (length === 1) { | 80 } else if (length === 1) { |
81 boundMethod = ANONYMOUS_FUNCTION(x => implementation(this, x)); | 81 boundMethod = ANONYMOUS_FUNCTION(fst => implementation(this, fst)); |
82 } else { | 82 } else { |
83 boundMethod = ANONYMOUS_FUNCTION((...args) => { | 83 boundMethod = ANONYMOUS_FUNCTION((...args) => { |
84 // DateTimeFormat.format needs to be 0 arg method, but can still | 84 // DateTimeFormat.format needs to be 0 arg method, but can still |
85 // receive an optional dateValue param. If one was provided, pass it | 85 // receive an optional dateValue param. If one was provided, pass it |
86 // along. | 86 // along. |
87 if (args.length > 0) { | 87 if (args.length > 0) { |
88 return implementation(this, args[0]); | 88 return implementation(this, args[0]); |
89 } else { | 89 } else { |
90 return implementation(this); | 90 return implementation(this); |
91 } | 91 } |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2268 } | 2268 } |
2269 ); | 2269 ); |
2270 | 2270 |
2271 %FunctionRemovePrototype(FormatDateToParts); | 2271 %FunctionRemovePrototype(FormatDateToParts); |
2272 | 2272 |
2273 utils.Export(function(to) { | 2273 utils.Export(function(to) { |
2274 to.FormatDateToParts = FormatDateToParts; | 2274 to.FormatDateToParts = FormatDateToParts; |
2275 }); | 2275 }); |
2276 | 2276 |
2277 }) | 2277 }) |
OLD | NEW |