Commit 06aeb4ec authored by littledan's avatar littledan Committed by Commit bot

[intl] Match the new Intl constructor semantics down to details

In spec review, the Intl constructor fallback semantics ended
up changing a bit; this patch updates V8 to the newest semantics.

BUG=v8:4360,v8:4870

Review-Url: https://codereview.chromium.org/2618533002
Cr-Commit-Position: refs/heads/master@{#43448}
parent 0a3060fa
...@@ -101,20 +101,14 @@ function IntlConstruct(receiver, constructor, create, newTarget, args, ...@@ -101,20 +101,14 @@ function IntlConstruct(receiver, constructor, create, newTarget, args,
var locales = args[0]; var locales = args[0];
var options = args[1]; var options = args[1];
if (IS_UNDEFINED(newTarget)) { var instance = create(locales, options);
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;
}
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;
} }
......
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