Commit db74cccf authored by bmeurer's avatar bmeurer Committed by Commit bot

[i18n] Replace uses of %_Arguments/%_ArgumentsLength with arguments.

No need to micro-optimize here, and in almost all cases here, using
arguments should result in roughly the same code w/ Crankshaft anyway.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1664513007

Cr-Commit-Position: refs/heads/master@{#33716}
parent 1ecf58f4
...@@ -232,8 +232,8 @@ function addBoundMethod(obj, methodName, implementation, length) { ...@@ -232,8 +232,8 @@ function addBoundMethod(obj, methodName, implementation, length) {
// DateTimeFormat.format needs to be 0 arg method, but can stil // DateTimeFormat.format needs to be 0 arg method, but can stil
// receive optional dateValue param. If one was provided, pass it // receive optional dateValue param. If one was provided, pass it
// along. // along.
if (%_ArgumentsLength() > 0) { if (arguments.length > 0) {
return implementation(that, %_Arguments(0)); return implementation(that, arguments[0]);
} else { } else {
return implementation(that); return implementation(that);
} }
...@@ -1002,8 +1002,8 @@ function initializeCollator(collator, locales, options) { ...@@ -1002,8 +1002,8 @@ function initializeCollator(collator, locales, options) {
* @constructor * @constructor
*/ */
%AddNamedProperty(Intl, 'Collator', function() { %AddNamedProperty(Intl, 'Collator', function() {
var locales = %_Arguments(0); var locales = arguments[0];
var options = %_Arguments(1); var options = arguments[1];
if (!this || this === Intl) { if (!this || this === Intl) {
// Constructor is called as a function. // Constructor is called as a function.
...@@ -1060,7 +1060,7 @@ function initializeCollator(collator, locales, options) { ...@@ -1060,7 +1060,7 @@ function initializeCollator(collator, locales, options) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
} }
return supportedLocalesOf('collator', locales, %_Arguments(1)); return supportedLocalesOf('collator', locales, arguments[1]);
}, },
DONT_ENUM DONT_ENUM
); );
...@@ -1255,8 +1255,8 @@ function initializeNumberFormat(numberFormat, locales, options) { ...@@ -1255,8 +1255,8 @@ function initializeNumberFormat(numberFormat, locales, options) {
* @constructor * @constructor
*/ */
%AddNamedProperty(Intl, 'NumberFormat', function() { %AddNamedProperty(Intl, 'NumberFormat', function() {
var locales = %_Arguments(0); var locales = arguments[0];
var options = %_Arguments(1); var options = arguments[1];
if (!this || this === Intl) { if (!this || this === Intl) {
// Constructor is called as a function. // Constructor is called as a function.
...@@ -1332,7 +1332,7 @@ function initializeNumberFormat(numberFormat, locales, options) { ...@@ -1332,7 +1332,7 @@ function initializeNumberFormat(numberFormat, locales, options) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
} }
return supportedLocalesOf('numberformat', locales, %_Arguments(1)); return supportedLocalesOf('numberformat', locales, arguments[1]);
}, },
DONT_ENUM DONT_ENUM
); );
...@@ -1659,8 +1659,8 @@ function initializeDateTimeFormat(dateFormat, locales, options) { ...@@ -1659,8 +1659,8 @@ function initializeDateTimeFormat(dateFormat, locales, options) {
* @constructor * @constructor
*/ */
%AddNamedProperty(Intl, 'DateTimeFormat', function() { %AddNamedProperty(Intl, 'DateTimeFormat', function() {
var locales = %_Arguments(0); var locales = arguments[0];
var options = %_Arguments(1); var options = arguments[1];
if (!this || this === Intl) { if (!this || this === Intl) {
// Constructor is called as a function. // Constructor is called as a function.
...@@ -1755,7 +1755,7 @@ function initializeDateTimeFormat(dateFormat, locales, options) { ...@@ -1755,7 +1755,7 @@ function initializeDateTimeFormat(dateFormat, locales, options) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
} }
return supportedLocalesOf('dateformat', locales, %_Arguments(1)); return supportedLocalesOf('dateformat', locales, arguments[1]);
}, },
DONT_ENUM DONT_ENUM
); );
...@@ -1886,8 +1886,8 @@ function initializeBreakIterator(iterator, locales, options) { ...@@ -1886,8 +1886,8 @@ function initializeBreakIterator(iterator, locales, options) {
* @constructor * @constructor
*/ */
%AddNamedProperty(Intl, 'v8BreakIterator', function() { %AddNamedProperty(Intl, 'v8BreakIterator', function() {
var locales = %_Arguments(0); var locales = arguments[0];
var options = %_Arguments(1); var options = arguments[1];
if (!this || this === Intl) { if (!this || this === Intl) {
// Constructor is called as a function. // Constructor is called as a function.
...@@ -1943,7 +1943,7 @@ function initializeBreakIterator(iterator, locales, options) { ...@@ -1943,7 +1943,7 @@ function initializeBreakIterator(iterator, locales, options) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
} }
return supportedLocalesOf('breakiterator', locales, %_Arguments(1)); return supportedLocalesOf('breakiterator', locales, arguments[1]);
}, },
DONT_ENUM DONT_ENUM
); );
...@@ -2061,8 +2061,8 @@ OverrideFunction(GlobalString.prototype, 'localeCompare', function(that) { ...@@ -2061,8 +2061,8 @@ OverrideFunction(GlobalString.prototype, 'localeCompare', function(that) {
throw MakeTypeError(kMethodInvokedOnNullOrUndefined); throw MakeTypeError(kMethodInvokedOnNullOrUndefined);
} }
var locales = %_Arguments(1); var locales = arguments[1];
var options = %_Arguments(2); var options = arguments[2];
var collator = cachedOrNewService('collator', locales, options); var collator = cachedOrNewService('collator', locales, options);
return compare(collator, this, that); return compare(collator, this, that);
} }
...@@ -2085,7 +2085,7 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() { ...@@ -2085,7 +2085,7 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() {
CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize"); CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize");
var s = TO_STRING(this); var s = TO_STRING(this);
var formArg = %_Arguments(0); var formArg = arguments[0];
var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING(formArg); var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING(formArg);
var NORMALIZATION_FORMS = ['NFC', 'NFD', 'NFKC', 'NFKD']; var NORMALIZATION_FORMS = ['NFC', 'NFD', 'NFKC', 'NFKD'];
...@@ -2114,8 +2114,8 @@ OverrideFunction(GlobalNumber.prototype, 'toLocaleString', function() { ...@@ -2114,8 +2114,8 @@ OverrideFunction(GlobalNumber.prototype, 'toLocaleString', function() {
throw MakeTypeError(kMethodInvokedOnWrongType, "Number"); throw MakeTypeError(kMethodInvokedOnWrongType, "Number");
} }
var locales = %_Arguments(0); var locales = arguments[0];
var options = %_Arguments(1); var options = arguments[1];
var numberFormat = cachedOrNewService('numberformat', locales, options); var numberFormat = cachedOrNewService('numberformat', locales, options);
return formatNumber(numberFormat, this); return formatNumber(numberFormat, this);
} }
...@@ -2151,8 +2151,8 @@ OverrideFunction(GlobalDate.prototype, 'toLocaleString', function() { ...@@ -2151,8 +2151,8 @@ OverrideFunction(GlobalDate.prototype, 'toLocaleString', function() {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
} }
var locales = %_Arguments(0); var locales = arguments[0];
var options = %_Arguments(1); var options = arguments[1];
return toLocaleDateTime( return toLocaleDateTime(
this, locales, options, 'any', 'all', 'dateformatall'); this, locales, options, 'any', 'all', 'dateformatall');
} }
...@@ -2169,8 +2169,8 @@ OverrideFunction(GlobalDate.prototype, 'toLocaleDateString', function() { ...@@ -2169,8 +2169,8 @@ OverrideFunction(GlobalDate.prototype, 'toLocaleDateString', function() {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
} }
var locales = %_Arguments(0); var locales = arguments[0];
var options = %_Arguments(1); var options = arguments[1];
return toLocaleDateTime( return toLocaleDateTime(
this, locales, options, 'date', 'date', 'dateformatdate'); this, locales, options, 'date', 'date', 'dateformatdate');
} }
...@@ -2187,8 +2187,8 @@ OverrideFunction(GlobalDate.prototype, 'toLocaleTimeString', function() { ...@@ -2187,8 +2187,8 @@ OverrideFunction(GlobalDate.prototype, 'toLocaleTimeString', function() {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor); throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
} }
var locales = %_Arguments(0); var locales = arguments[0];
var options = %_Arguments(1); var options = arguments[1];
return toLocaleDateTime( return toLocaleDateTime(
this, locales, options, 'time', 'time', 'dateformattime'); this, locales, options, 'time', 'time', 'dateformattime');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment