Skip to content

Commit 312a878

Browse files
authored
Implement Object.hasOwn (#6726)
1 parent 0c6561c commit 312a878

19 files changed

+19619
-19570
lines changed

lib/Backend/Inline.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3813,6 +3813,10 @@ Inline::SetupInlineInstrForCallDirect(Js::BuiltinFunction builtInId, IR::Instr*
38133813
callInstr->SetSrc1(IR::HelperCallOpnd::New(IR::JnHelperMethod::HelperObject_HasOwnProperty, callInstr->m_func));
38143814
break;
38153815

3816+
case Js::BuiltinFunction::JavascriptObject_HasOwn:
3817+
callInstr->SetSrc1(IR::HelperCallOpnd::New(IR::JnHelperMethod::HelperObject_HasOwn, callInstr->m_func));
3818+
break;
3819+
38163820
case Js::BuiltinFunction::JavascriptArray_IsArray:
38173821
callInstr->SetSrc1(IR::HelperCallOpnd::New(IR::JnHelperMethod::HelperArray_IsArray, callInstr->m_func));
38183822
break;

lib/Backend/InliningDecider.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ bool InliningDecider::GetBuiltInInfoCommon(
540540

541541
case Js::JavascriptBuiltInFunction::JavascriptArray_Includes:
542542
case Js::JavascriptBuiltInFunction::JavascriptObject_HasOwnProperty:
543+
case Js::JavascriptBuiltInFunction::JavascriptObject_HasOwn:
543544
case Js::JavascriptBuiltInFunction::JavascriptArray_IsArray:
544545
*returnType = ValueType::Boolean;
545546
goto CallDirectCommon;

lib/Backend/JnHelperMethodList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ HELPERCALL(String_PadStart, Js::JavascriptString::EntryPadStart, 0)
525525
HELPERCALL(String_PadEnd, Js::JavascriptString::EntryPadEnd, 0)
526526
HELPERCALLCHK(GlobalObject_ParseInt, Js::GlobalObject::EntryParseInt, 0)
527527
HELPERCALLCHK(Object_HasOwnProperty, Js::JavascriptObject::EntryHasOwnProperty, 0)
528+
HELPERCALLCHK(Object_HasOwn, Js::JavascriptObject::EntryHasOwn, 0)
528529

529530
HELPERCALL(RegExp_SplitResultUsed, Js::RegexHelper::RegexSplitResultUsed, 0)
530531
HELPERCALL(RegExp_SplitResultUsedAndMayBeTemp, Js::RegexHelper::RegexSplitResultUsedAndMayBeTemp, 0)

lib/Runtime/Base/JnDirectFields.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ ENTRY(getUTCSeconds)
197197
ENTRY(getYear)
198198
ENTRY(has)
199199
ENTRY(hasInstance)
200+
ENTRY(hasOwn)
200201
ENTRY(hasOwnProperty)
201202
ENTRY(includes)
202203
ENTRY(indexOf)

lib/Runtime/ByteCode/ByteCodeCacheReleaseFileVersion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// NOTE: If there is a merge conflict the correct fix is to make a new GUID.
77
// This file was generated with tools/regenByteCode.py
88

9-
// {7e624f04-e6a9-408a-9a53-d067a2b1c80e}
9+
// {0758006c-1750-4081-b107-c08101300fac}
1010
const GUID byteCodeCacheReleaseFileVersion =
11-
{ 0x7e624f04, 0xe6a9, 0x408a, {0x9a, 0x53, 0xd0, 0x67, 0xa2, 0xb1, 0xc8, 0x0e } };
11+
{ 0x0758006c, 0x1750, 0x4081, {0xb1, 0x07, 0xc0, 0x81, 0x01, 0x30, 0x0f, 0xac } };
1212

lib/Runtime/Library/InJavascript/JsBuiltIn.bc.32b.h

Lines changed: 5190 additions & 5189 deletions
Large diffs are not rendered by default.

lib/Runtime/Library/InJavascript/JsBuiltIn.bc.64b.h

Lines changed: 5188 additions & 5188 deletions
Large diffs are not rendered by default.

lib/Runtime/Library/InJavascript/JsBuiltIn.nojit.bc.32b.h

Lines changed: 4569 additions & 4569 deletions
Large diffs are not rendered by default.

lib/Runtime/Library/InJavascript/JsBuiltIn.nojit.bc.64b.h

Lines changed: 4570 additions & 4569 deletions
Large diffs are not rendered by default.

lib/Runtime/Library/JavascriptBuiltInFunctionList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ BUILTIN(JavascriptNumber, ValueOf, EntryValueOf, FunctionInfo::ErrorOnNew | Func
174174
BUILTIN(JavascriptObject, NewInstance, NewInstance, FunctionInfo::SkipDefaultNewObject)
175175
BUILTIN(JavascriptObject, HasOwnProperty, EntryHasOwnProperty, FunctionInfo::ErrorOnNew)
176176
BUILTIN(JavascriptObject, PropertyIsEnumerable, EntryPropertyIsEnumerable, FunctionInfo::ErrorOnNew)
177+
BUILTIN(JavascriptObject, HasOwn, EntryHasOwn, FunctionInfo::ErrorOnNew)
177178
BUILTIN(JavascriptObject, IsPrototypeOf, EntryIsPrototypeOf, FunctionInfo::ErrorOnNew)
178179
BUILTIN(JavascriptObject, ToLocaleString, EntryToLocaleString, FunctionInfo::ErrorOnNew)
179180
BUILTIN(JavascriptObject, ToString, EntryToString, FunctionInfo::ErrorOnNew | FunctionInfo::HasNoSideEffect)

0 commit comments

Comments
 (0)