From d05bc117304fcfdaf609321d9f9bf77de61e7d9e Mon Sep 17 00:00:00 2001 From: Michael Ferris Date: Mon, 22 Oct 2018 19:59:31 -0700 Subject: [PATCH] Fix build after Windows 1809 October Update merge --- lib/Runtime/Base/CrossSite.cpp | 4 ++-- lib/Runtime/Library/JavascriptError.cpp | 4 ++-- lib/Runtime/Types/UnscopablesWrapperObject.cpp | 17 ----------------- lib/Runtime/Types/UnscopablesWrapperObject.h | 3 --- 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/lib/Runtime/Base/CrossSite.cpp b/lib/Runtime/Base/CrossSite.cpp index 3050a957e27..b6ecf1d9395 100644 --- a/lib/Runtime/Base/CrossSite.cpp +++ b/lib/Runtime/Base/CrossSite.cpp @@ -128,10 +128,10 @@ namespace Js for (uint16 i = 0; i < length; i++) { Var value = display->GetItem(i); - if (UnscopablesWrapperObject::Is(value)) + if (Js::VarIs(value)) { // Here we are marshalling the wrappedObject and then ReWrapping th object in the new context. - RecyclableObject* wrappedObject = UnscopablesWrapperObject::FromVar(value)->GetWrappedObject(); + RecyclableObject* wrappedObject = Js::VarTo(value)->GetWrappedObject(); ScriptContext* wrappedObjectScriptContext = wrappedObject->GetScriptContext(); value = JavascriptOperators::ToUnscopablesWrapperObject(CrossSite::MarshalVar(scriptContext, wrappedObject, wrappedObjectScriptContext), scriptContext); diff --git a/lib/Runtime/Library/JavascriptError.cpp b/lib/Runtime/Library/JavascriptError.cpp index 471d734ed0e..1509ed3321f 100644 --- a/lib/Runtime/Library/JavascriptError.cpp +++ b/lib/Runtime/Library/JavascriptError.cpp @@ -773,8 +773,8 @@ namespace Js // two error codes is morally equivalent in typeof scenario. Special case this here // because we do not want typeof to leak these exceptions. && !(errorObject != nullptr - && Js::JavascriptError::Is(errorObject) - && Js::JavascriptError::FromVar(errorObject)->GetErrorType() == kjstWinRTError + && Js::VarIs(errorObject) + && Js::VarTo(errorObject)->GetErrorType() == kjstWinRTError && hr == TYPE_E_ELEMENTNOTFOUND) #endif ; diff --git a/lib/Runtime/Types/UnscopablesWrapperObject.cpp b/lib/Runtime/Types/UnscopablesWrapperObject.cpp index aaeb6c53b93..9d8983c73e3 100644 --- a/lib/Runtime/Types/UnscopablesWrapperObject.cpp +++ b/lib/Runtime/Types/UnscopablesWrapperObject.cpp @@ -6,23 +6,6 @@ namespace Js { - bool UnscopablesWrapperObject::Is(Var aValue) - { - return JavascriptOperators::GetTypeId(aValue) == TypeIds_UnscopablesWrapperObject; - } - - UnscopablesWrapperObject* UnscopablesWrapperObject::FromVar(Var aValue) - { - AssertOrFailFast(UnscopablesWrapperObject::Is(aValue)); - return static_cast(aValue); - } - - UnscopablesWrapperObject* UnscopablesWrapperObject::UnsafeFromVar(Var aValue) - { - Assert(UnscopablesWrapperObject::Is(aValue)); - return static_cast(aValue); - } - PropertyQueryFlags UnscopablesWrapperObject::HasPropertyQuery(PropertyId propertyId, _Inout_opt_ PropertyValueInfo* info) { return JavascriptConversion::BooleanToPropertyQueryFlags(JavascriptOperators::HasPropertyUnscopables(wrappedObject, propertyId)); diff --git a/lib/Runtime/Types/UnscopablesWrapperObject.h b/lib/Runtime/Types/UnscopablesWrapperObject.h index 5a33b060127..35d1e6e8471 100644 --- a/lib/Runtime/Types/UnscopablesWrapperObject.h +++ b/lib/Runtime/Types/UnscopablesWrapperObject.h @@ -25,9 +25,6 @@ namespace Js public: UnscopablesWrapperObject(RecyclableObject *wrappedObject, StaticType * type) : RecyclableObject(type), wrappedObject(wrappedObject) {} - static bool Is(Var aValue); - static UnscopablesWrapperObject* FromVar(Var value); - static UnscopablesWrapperObject* UnsafeFromVar(Var value); RecyclableObject *GetWrappedObject() { return wrappedObject; } virtual PropertyQueryFlags HasPropertyQuery(PropertyId propertyId, _Inout_opt_ PropertyValueInfo* info) override; virtual BOOL HasOwnProperty(PropertyId propertyId) override;