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

Unified Diff: src/js/i18n.js

Issue 2618533002: [intl] Match the new Intl constructor semantics down to details (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/i18n.js
diff --git a/src/js/i18n.js b/src/js/i18n.js
index 5589701b1819fa11b762ec584a519d0eef327c50..cbd6929cc7d76c36ef2ec2854b60b376abcb1fff 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -101,20 +101,14 @@ function IntlConstruct(receiver, constructor, create, newTarget, args,
var locales = args[0];
var options = args[1];
- if (IS_UNDEFINED(newTarget)) {
- if (compat && receiver instanceof constructor) {
- let success = %object_define_property(receiver, IntlFallbackSymbol,
- { value: new constructor(locales, options) });
- if (!success) {
- throw %make_type_error(kReinitializeIntl, constructor);
- }
- return receiver;
- }
+ var instance = create(locales, options);
- return new constructor(locales, options);
+ if (compat && IS_UNDEFINED(newTarget) && receiver instanceof constructor) {
+ %object_define_property(receiver, IntlFallbackSymbol, { value: instance });
+ return receiver;
}
- return create(locales, options);
+ return instance;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698