Skip to content

Commit

Permalink
fix conflicts from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
sethbrenith committed Sep 19, 2018
1 parent 88700a1 commit a237490
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/Runtime/Base/CrossSite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace Js
{
MarshalDynamicObject(scriptContext, prototypeObject);
}
if (JavascriptProxy::Is(prototypeObject))
if (VarIs<JavascriptProxy>(prototypeObject))
{
// Fetching prototype of proxy can invoke trap - which we don't want during the marshalling time.
break;
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Base/ScriptContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4173,7 +4173,7 @@ namespace Js
#endif

#ifdef ASMJS_PLAT
ScriptFunction * scriptFunction = ScriptFunction::FromVar(pFunction);
ScriptFunction * scriptFunction = VarTo<ScriptFunction>(pFunction);
scriptContext->TransitionEnvironmentForDebugger(scriptFunction);
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Runtime/Language/JavascriptConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ using namespace Js;
// For all other types, convert the key into a string and use that as the property name
JavascriptString * propName = JavascriptConversion::ToString(key, scriptContext);
propName->GetPropertyRecord(propertyRecord);
if (PropertyString::Is(propName))
if (VarIs<PropertyString>(propName))
{
propertyString = PropertyString::UnsafeFromVar(propName);
propertyString = UnsafeVarTo<PropertyString>(propName);
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Runtime/Language/JavascriptOperators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7181,8 +7181,8 @@ using namespace Js;
DynamicType* newType = nullptr;
if (nonSimpleParamList)
{
bool skipLetAttrForArguments = ((JavascriptGeneratorFunction::Is(funcCallee) || JavascriptAsyncFunction::Is(funcCallee)) ?
JavascriptGeneratorFunction::FromVar(funcCallee)->GetGeneratorVirtualScriptFunction()->GetFunctionBody()->HasReferenceableBuiltInArguments()
bool skipLetAttrForArguments = ((VarIs<JavascriptGeneratorFunction>(funcCallee) || VarIs<JavascriptAsyncFunction>(funcCallee)) ?
VarTo<JavascriptGeneratorFunction>(funcCallee)->GetGeneratorVirtualScriptFunction()->GetFunctionBody()->HasReferenceableBuiltInArguments()
: funcCallee->GetFunctionBody()->HasReferenceableBuiltInArguments());

if (skipLetAttrForArguments)
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Language/JavascriptOperators.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Js
{ \
Js::Var errorObject = exceptionObject->GetThrownObject(nullptr); \
HRESULT hr = (errorObject != nullptr && Js::VarIs<Js::JavascriptError>(errorObject)) \
? Js::JavascriptError::GetRuntimeError(Js::VarIs<Js::RecyclableObject>(errorObject), nullptr) \
? Js::JavascriptError::GetRuntimeError(Js::VarTo<Js::RecyclableObject>(errorObject), nullptr) \
: S_OK; \
if (JavascriptError::GetErrorNumberFromResourceID(JSERR_UndefVariable) != (int32)hr) \
{ \
Expand Down
10 changes: 5 additions & 5 deletions lib/Runtime/Library/EngineInterfaceObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,16 @@ namespace Js
EngineInterfaceObject_CommonFunctionProlog(function, callInfo);
#pragma warning(pop)

AssertOrFailFast((args.Info.Count == 3 || args.Info.Count == 4) && ScriptFunction::Is(args.Values[1]) && JavascriptString::Is(args.Values[2]));
AssertOrFailFast((args.Info.Count == 3 || args.Info.Count == 4) && VarIs<ScriptFunction>(args.Values[1]) && VarIs<JavascriptString>(args.Values[2]));

ScriptFunction *func = ScriptFunction::UnsafeFromVar(args[1]);
JavascriptString *methodName = JavascriptString::UnsafeFromVar(args[2]);
ScriptFunction *func = UnsafeVarTo<ScriptFunction>(args[1]);
JavascriptString *methodName = UnsafeVarTo<JavascriptString>(args[2]);

bool isConstructor = true;
if (args.Info.Count == 4)
{
AssertOrFailFast(JavascriptBoolean::Is(args.Values[3]));
isConstructor = JavascriptBoolean::UnsafeFromVar(args.Values[3])->GetValue();
AssertOrFailFast(VarIs<JavascriptBoolean>(args.Values[3]));
isConstructor = UnsafeVarTo<JavascriptBoolean>(args.Values[3])->GetValue();
}

// isConstructor = true is the default (when no 3rd arg is provided)
Expand Down
8 changes: 4 additions & 4 deletions lib/Runtime/Library/JavascriptArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ using namespace Js;

*isObjectWithArrayRef = false;

if (!RecyclableObject::Is(var))
if (!VarIs<RecyclableObject>(var))
{
return nullptr;
}
Expand All @@ -619,7 +619,7 @@ using namespace Js;

if (!array)
{
array = FromVar(var);
array = VarTo<JavascriptArray>(var);
}
return array;
}
Expand All @@ -633,8 +633,8 @@ using namespace Js;
if (*pVTable == VirtualTableInfo<DynamicObject>::Address ||
*pVTable == VirtualTableInfo<CrossSiteObject<DynamicObject>>::Address)
{
ArrayObject* objectArray = DynamicObject::FromVar(var)->GetObjectArray();
*pArray = (objectArray && Is(objectArray)) ? FromVar(objectArray) : nullptr;
ArrayObject* objectArray = VarTo<DynamicObject>(var)->GetObjectArray();
*pArray = (objectArray && VarIs<JavascriptArray>(objectArray)) ? VarTo<JavascriptArray>(objectArray) : nullptr;
if (!(*pArray))
{
return false;
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Library/JavascriptLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ namespace Js
bool JavascriptLibrary::InitializeAsyncFunction(DynamicObject *function, DeferredTypeHandlerBase * typeHandler, DeferredInitializeMode mode)
{
// Async function instances do not have a prototype property as they are not constructable
JavascriptAsyncFunction* asyncFunction = JavascriptAsyncFunction::FromVar(function);
JavascriptAsyncFunction* asyncFunction = VarTo<JavascriptAsyncFunction>(function);

if (!asyncFunction->IsAnonymousFunction())
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Library/JavascriptObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ BOOL JavascriptObject::DefineOwnPropertyHelper(RecyclableObject* obj, PropertyId
else if (DynamicObject::IsAnyTypedArray(obj))
{
returnValue = JavascriptOperators::DefineOwnPropertyForTypedArray(
TypedArrayBase::FromVar(obj), propId, descriptor, throwOnError, scriptContext);
VarTo<TypedArrayBase>(obj), propId, descriptor, throwOnError, scriptContext);
}
// TODO: implement DefineOwnProperty for other object built-in exotic types.
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ namespace Js

// chakra library functions, since they aren't public, can be constructors (__chakraLibrary.ArrayIterator is one)
ScriptFunction* func = EngineInterfaceObject::CreateLibraryCodeScriptFunction(
ScriptFunction::UnsafeFromVar(args.Values[2]),
UnsafeVarTo<ScriptFunction>(args.Values[2]),
methodName,
true /* isConstructor */,
true /* isJsBuiltIn */,
Expand Down Expand Up @@ -323,7 +323,7 @@ FUNCTIONKIND_VALUES(VALUE)
}

ScriptFunction *func = EngineInterfaceObject::CreateLibraryCodeScriptFunction(
ScriptFunction::UnsafeFromVar(args.Values[2]),
UnsafeVarTo<ScriptFunction>(args.Values[2]),
fullName,
false /* isConstructor */,
true /* isJsBuiltIn */,
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Library/TypedArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace Js

virtual BOOL InitProperty(Js::PropertyId propertyId, Js::Var value, PropertyOperationFlags flags = PropertyOperation_None, Js::PropertyValueInfo* info = NULL) override;
virtual BOOL SetPropertyWithAttributes(PropertyId propertyId, Var value, PropertyAttributes attributes, PropertyValueInfo* info, PropertyOperationFlags flags = PropertyOperation_None, SideEffects possibleSideEffects = SideEffects_Any) override;
static bool Is(TypeId typeId);
static BOOL Is(TypeId typeId);
// Returns false if this is not a TypedArray or it's not detached
static BOOL IsDetachedTypedArray(Var aValue);
static HRESULT GetBuffer(Var aValue, ArrayBuffer** outBuffer, uint32* outOffset, uint32* outLength);
Expand Down

0 comments on commit a237490

Please sign in to comment.