Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: src/i18n.js

Issue 1127543003: Revert of Reland "Wrap v8natives.js into a function." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/harmony-typedarray.js ('k') | src/json.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/i18n.js
diff --git a/src/i18n.js b/src/i18n.js
index ec6518a33dc8e5cd7892a417af57588d3d9ca51b..46e8bb88e5829254bdca044cb431bb628b5fa07e 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -254,7 +254,7 @@
}
}
}
- $setFunctionName(boundMethod, internalName);
+ SetFunctionName(boundMethod, internalName);
%FunctionRemovePrototype(boundMethod);
%SetNativeFlag(boundMethod);
this[internalName] = boundMethod;
@@ -262,11 +262,11 @@
return this[internalName];
}
- $setFunctionName(getter, methodName);
+ SetFunctionName(getter, methodName);
%FunctionRemovePrototype(getter);
%SetNativeFlag(getter);
- $objectDefineProperty(obj.prototype, methodName, {
+ ObjectDefineProperty(obj.prototype, methodName, {
get: getter,
enumerable: false,
configurable: true
@@ -585,14 +585,14 @@
*/
function freezeArray(array) {
array.forEach(function(element, index) {
- $objectDefineProperty(array, index, {value: element,
- configurable: false,
- writable: false,
- enumerable: true});
+ ObjectDefineProperty(array, index, {value: element,
+ configurable: false,
+ writable: false,
+ enumerable: true});
});
- $objectDefineProperty(array, 'length', {value: array.length,
- writable: false});
+ ObjectDefineProperty(array, 'length', {value: array.length,
+ writable: false});
return array;
}
@@ -653,8 +653,8 @@
* Configurable is false by default.
*/
function defineWEProperty(object, property, value) {
- $objectDefineProperty(object, property,
- {value: value, writable: true, enumerable: true});
+ ObjectDefineProperty(object, property,
+ {value: value, writable: true, enumerable: true});
}
@@ -673,10 +673,11 @@
* Defines a property and sets writable, enumerable and configurable to true.
*/
function defineWECProperty(object, property, value) {
- $objectDefineProperty(object, property, {value: value,
- writable: true,
- enumerable: true,
- configurable: true});
+ ObjectDefineProperty(object, property,
+ {value: value,
+ writable: true,
+ enumerable: true,
+ configurable: true});
}
@@ -916,7 +917,7 @@
// problems. If malicious user decides to redefine Object.prototype.locale
// we can't just use plain x.locale = 'us' or in C++ Set("locale", "us").
// ObjectDefineProperties will either succeed defining or throw an error.
- var resolved = $objectDefineProperties({}, {
+ var resolved = ObjectDefineProperties({}, {
caseFirst: {writable: true},
collation: {value: internalOptions.collation, writable: true},
ignorePunctuation: {writable: true},
@@ -934,7 +935,7 @@
// Writable, configurable and enumerable are set to false by default.
%MarkAsInitializedIntlObjectOfType(collator, 'collator', internalCollator);
- $objectDefineProperty(collator, 'resolved', {value: resolved});
+ ObjectDefineProperty(collator, 'resolved', {value: resolved});
return collator;
}
@@ -989,7 +990,7 @@
},
DONT_ENUM
);
-$setFunctionName(Intl.Collator.prototype.resolvedOptions, 'resolvedOptions');
+SetFunctionName(Intl.Collator.prototype.resolvedOptions, 'resolvedOptions');
%FunctionRemovePrototype(Intl.Collator.prototype.resolvedOptions);
%SetNativeFlag(Intl.Collator.prototype.resolvedOptions);
@@ -1009,7 +1010,7 @@
},
DONT_ENUM
);
-$setFunctionName(Intl.Collator.supportedLocalesOf, 'supportedLocalesOf');
+SetFunctionName(Intl.Collator.supportedLocalesOf, 'supportedLocalesOf');
%FunctionRemovePrototype(Intl.Collator.supportedLocalesOf);
%SetNativeFlag(Intl.Collator.supportedLocalesOf);
@@ -1130,7 +1131,7 @@
getOption, internalOptions);
var requestedLocale = locale.locale + extension;
- var resolved = $objectDefineProperties({}, {
+ var resolved = ObjectDefineProperties({}, {
currency: {writable: true},
currencyDisplay: {writable: true},
locale: {writable: true},
@@ -1155,12 +1156,12 @@
// We can't get information about number or currency style from ICU, so we
// assume user request was fulfilled.
if (internalOptions.style === 'currency') {
- $objectDefineProperty(resolved, 'currencyDisplay', {value: currencyDisplay,
- writable: true});
+ ObjectDefineProperty(resolved, 'currencyDisplay', {value: currencyDisplay,
+ writable: true});
}
%MarkAsInitializedIntlObjectOfType(numberFormat, 'numberformat', formatter);
- $objectDefineProperty(numberFormat, 'resolved', {value: resolved});
+ ObjectDefineProperty(numberFormat, 'resolved', {value: resolved});
return numberFormat;
}
@@ -1233,7 +1234,7 @@
},
DONT_ENUM
);
-$setFunctionName(Intl.NumberFormat.prototype.resolvedOptions,
+SetFunctionName(Intl.NumberFormat.prototype.resolvedOptions,
'resolvedOptions');
%FunctionRemovePrototype(Intl.NumberFormat.prototype.resolvedOptions);
%SetNativeFlag(Intl.NumberFormat.prototype.resolvedOptions);
@@ -1254,7 +1255,7 @@
},
DONT_ENUM
);
-$setFunctionName(Intl.NumberFormat.supportedLocalesOf, 'supportedLocalesOf');
+SetFunctionName(Intl.NumberFormat.supportedLocalesOf, 'supportedLocalesOf');
%FunctionRemovePrototype(Intl.NumberFormat.supportedLocalesOf);
%SetNativeFlag(Intl.NumberFormat.supportedLocalesOf);
@@ -1450,33 +1451,33 @@
}
if (needsDefault && (defaults === 'date' || defaults === 'all')) {
- $objectDefineProperty(options, 'year', {value: 'numeric',
+ ObjectDefineProperty(options, 'year', {value: 'numeric',
+ writable: true,
+ enumerable: true,
+ configurable: true});
+ ObjectDefineProperty(options, 'month', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
- $objectDefineProperty(options, 'month', {value: 'numeric',
+ ObjectDefineProperty(options, 'day', {value: 'numeric',
+ writable: true,
+ enumerable: true,
+ configurable: true});
+ }
+
+ if (needsDefault && (defaults === 'time' || defaults === 'all')) {
+ ObjectDefineProperty(options, 'hour', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
- $objectDefineProperty(options, 'day', {value: 'numeric',
- writable: true,
- enumerable: true,
- configurable: true});
- }
-
- if (needsDefault && (defaults === 'time' || defaults === 'all')) {
- $objectDefineProperty(options, 'hour', {value: 'numeric',
- writable: true,
- enumerable: true,
- configurable: true});
- $objectDefineProperty(options, 'minute', {value: 'numeric',
- writable: true,
- enumerable: true,
- configurable: true});
- $objectDefineProperty(options, 'second', {value: 'numeric',
- writable: true,
- enumerable: true,
- configurable: true});
+ ObjectDefineProperty(options, 'minute', {value: 'numeric',
+ writable: true,
+ enumerable: true,
+ configurable: true});
+ ObjectDefineProperty(options, 'second', {value: 'numeric',
+ writable: true,
+ enumerable: true,
+ configurable: true});
}
return options;
@@ -1524,7 +1525,7 @@
getOption, internalOptions);
var requestedLocale = locale.locale + extension;
- var resolved = $objectDefineProperties({}, {
+ var resolved = ObjectDefineProperties({}, {
calendar: {writable: true},
day: {writable: true},
era: {writable: true},
@@ -1552,7 +1553,7 @@
}
%MarkAsInitializedIntlObjectOfType(dateFormat, 'dateformat', formatter);
- $objectDefineProperty(dateFormat, 'resolved', {value: resolved});
+ ObjectDefineProperty(dateFormat, 'resolved', {value: resolved});
return dateFormat;
}
@@ -1625,7 +1626,7 @@
},
DONT_ENUM
);
-$setFunctionName(Intl.DateTimeFormat.prototype.resolvedOptions,
+SetFunctionName(Intl.DateTimeFormat.prototype.resolvedOptions,
'resolvedOptions');
%FunctionRemovePrototype(Intl.DateTimeFormat.prototype.resolvedOptions);
%SetNativeFlag(Intl.DateTimeFormat.prototype.resolvedOptions);
@@ -1646,7 +1647,7 @@
},
DONT_ENUM
);
-$setFunctionName(Intl.DateTimeFormat.supportedLocalesOf, 'supportedLocalesOf');
+SetFunctionName(Intl.DateTimeFormat.supportedLocalesOf, 'supportedLocalesOf');
%FunctionRemovePrototype(Intl.DateTimeFormat.supportedLocalesOf);
%SetNativeFlag(Intl.DateTimeFormat.supportedLocalesOf);
@@ -1741,7 +1742,7 @@
'type', 'string', ['character', 'word', 'sentence', 'line'], 'word'));
var locale = resolveLocale('breakiterator', locales, options);
- var resolved = $objectDefineProperties({}, {
+ var resolved = ObjectDefineProperties({}, {
requestedLocale: {value: locale.locale, writable: true},
type: {value: internalOptions.type, writable: true},
locale: {writable: true}
@@ -1753,7 +1754,7 @@
%MarkAsInitializedIntlObjectOfType(iterator, 'breakiterator',
internalIterator);
- $objectDefineProperty(iterator, 'resolved', {value: resolved});
+ ObjectDefineProperty(iterator, 'resolved', {value: resolved});
return iterator;
}
@@ -1804,7 +1805,7 @@
},
DONT_ENUM
);
-$setFunctionName(Intl.v8BreakIterator.prototype.resolvedOptions,
+SetFunctionName(Intl.v8BreakIterator.prototype.resolvedOptions,
'resolvedOptions');
%FunctionRemovePrototype(Intl.v8BreakIterator.prototype.resolvedOptions);
%SetNativeFlag(Intl.v8BreakIterator.prototype.resolvedOptions);
@@ -1826,7 +1827,7 @@
},
DONT_ENUM
);
-$setFunctionName(Intl.v8BreakIterator.supportedLocalesOf, 'supportedLocalesOf');
+SetFunctionName(Intl.v8BreakIterator.supportedLocalesOf, 'supportedLocalesOf');
%FunctionRemovePrototype(Intl.v8BreakIterator.supportedLocalesOf);
%SetNativeFlag(Intl.v8BreakIterator.supportedLocalesOf);
@@ -1920,7 +1921,7 @@
* Compares this and that, and returns less than 0, 0 or greater than 0 value.
* Overrides the built-in method.
*/
-$overrideFunction(GlobalString.prototype, 'localeCompare', function(that) {
+OverrideFunction(GlobalString.prototype, 'localeCompare', function(that) {
if (%_IsConstructCall()) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
}
@@ -1944,7 +1945,7 @@
* If the form is not one of "NFC", "NFD", "NFKC", or "NFKD", then throw
* a RangeError Exception.
*/
-$overrideFunction(GlobalString.prototype, 'normalize', function(that) {
+OverrideFunction(GlobalString.prototype, 'normalize', function(that) {
if (%_IsConstructCall()) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
}
@@ -1967,7 +1968,7 @@
* Formats a Number object (this) using locale and options values.
* If locale or options are omitted, defaults are used.
*/
-$overrideFunction(GlobalNumber.prototype, 'toLocaleString', function() {
+OverrideFunction(GlobalNumber.prototype, 'toLocaleString', function() {
if (%_IsConstructCall()) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
}
@@ -2010,7 +2011,7 @@
* If locale or options are omitted, defaults are used - both date and time are
* present in the output.
*/
-$overrideFunction(GlobalDate.prototype, 'toLocaleString', function() {
+OverrideFunction(GlobalDate.prototype, 'toLocaleString', function() {
if (%_IsConstructCall()) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
}
@@ -2028,7 +2029,7 @@
* If locale or options are omitted, defaults are used - only date is present
* in the output.
*/
-$overrideFunction(GlobalDate.prototype, 'toLocaleDateString', function() {
+OverrideFunction(GlobalDate.prototype, 'toLocaleDateString', function() {
if (%_IsConstructCall()) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
}
@@ -2046,7 +2047,7 @@
* If locale or options are omitted, defaults are used - only time is present
* in the output.
*/
-$overrideFunction(GlobalDate.prototype, 'toLocaleTimeString', function() {
+OverrideFunction(GlobalDate.prototype, 'toLocaleTimeString', function() {
if (%_IsConstructCall()) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
}
« no previous file with comments | « src/harmony-typedarray.js ('k') | src/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698