mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-24 02:30:03 +00:00
fix bug for UnwrapNumberFormatUseOrdinaryHasInstance.js
Signed-off-by: liujia178 <liujia178@huawei.com>
This commit is contained in:
parent
72addd1a02
commit
51d07b319e
@ -66,14 +66,16 @@ JSTaggedValue BuiltinsNumberFormat::NumberFormatConstructor(EcmaRuntimeCallInfo
|
||||
// a. Perform ? DefinePropertyOrThrow(this, %Intl%.[[FallbackSymbol]], PropertyDescriptor{
|
||||
// [[Value]]: numberFormat, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }).
|
||||
// b. Return this.
|
||||
bool isInstanceOf = JSObject::InstanceOf(thread, thisValue, env->GetNumberFormatFunction());
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
if (newTarget->IsUndefined() && thisValue->IsJSObject() && isInstanceOf) {
|
||||
PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>::Cast(numberFormat), false, false, false);
|
||||
JSHandle<JSTaggedValue> key(thread, JSHandle<JSIntl>::Cast(env->GetIntlFunction())->GetFallbackSymbol());
|
||||
JSTaggedValue::DefinePropertyOrThrow(thread, thisValue, key, descriptor);
|
||||
if (newTarget->IsUndefined() && thisValue->IsJSObject()) {
|
||||
bool isInstanceOf = JSObject::InstanceOf(thread, thisValue, env->GetNumberFormatFunction());
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
return thisValue.GetTaggedValue();
|
||||
if (isInstanceOf) {
|
||||
PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>::Cast(numberFormat), false, false, false);
|
||||
JSHandle<JSTaggedValue> key(thread, JSHandle<JSIntl>::Cast(env->GetIntlFunction())->GetFallbackSymbol());
|
||||
JSTaggedValue::DefinePropertyOrThrow(thread, thisValue, key, descriptor);
|
||||
RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
|
||||
return thisValue.GetTaggedValue();
|
||||
}
|
||||
}
|
||||
|
||||
// 6. Return numberFormat.
|
||||
|
@ -877,7 +877,7 @@ JSHandle<JSTaggedValue> JSNumberFormat::UnwrapNumberFormat(JSThread *thread, con
|
||||
// 2. If nf does not have an [[InitializedNumberFormat]] internal slot and ?
|
||||
// InstanceofOperator(nf, %NumberFormat%) is true, then Let nf be ? Get(nf, %Intl%.[[FallbackSymbol]]).
|
||||
JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv();
|
||||
bool hasInstance = JSObject::InstanceOf(thread, nf, env->GetNumberFormatFunction());
|
||||
bool hasInstance = JSFunction::OrdinaryHasInstance(thread, env->GetNumberFormatFunction(), nf);
|
||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined()));
|
||||
|
||||
bool isJSNumberFormat = nf->IsJSNumberFormat();
|
||||
|
@ -1663,7 +1663,6 @@
|
||||
"intl/number-format/rounding-increment-v3.js",
|
||||
"intl/number-format/format-range-string.js",
|
||||
"intl/number-format/format-string.js",
|
||||
"intl/number-format/UnwrapNumberFormatUseOrdinaryHasInstance.js",
|
||||
"intl/number-format/rounding-increment-resolved-match-v3.js",
|
||||
"intl/number-format/format-range-numbering-system.js",
|
||||
"intl/number-format/check-digit-ranges.js",
|
||||
|
Loading…
Reference in New Issue
Block a user