Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
[Merge chakra-core/ChakraCore@1202ba28d4] [MERGE #3878 @obastemur] fi…
Browse files Browse the repository at this point in the history
…x: fails to compare to undefined on cross context

Merge pull request #3878 from obastemur:imp_undef_obj
  • Loading branch information
chakrabot committed Oct 6, 2017
1 parent 0be48b0 commit d7d956d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ namespace Js
const char16 *givenLocale = nullptr;
defaultLocale[0] = '\0';

if (!JavascriptOperators::IsUndefinedObject(args.Values[3], scriptContext))
if (!JavascriptOperators::IsUndefinedObject(args.Values[3]))
{
if (!JavascriptString::Is(args.Values[3]))
{
Expand All @@ -1233,7 +1233,7 @@ namespace Js
givenLocale = JavascriptString::FromVar(args.Values[3])->GetSz();
}

if (!JavascriptOperators::IsUndefinedObject(args.Values[4], scriptContext))
if (!JavascriptOperators::IsUndefinedObject(args.Values[4]))
{
if (!JavascriptString::Is(args.Values[4]))
{
Expand All @@ -1246,7 +1246,7 @@ namespace Js
compareFlags |= NORM_LINGUISTIC_CASING;
}

if (!JavascriptOperators::IsUndefinedObject(args.Values[5], scriptContext))
if (!JavascriptOperators::IsUndefinedObject(args.Values[5]))
{
if (!JavascriptBoolean::Is(args.Values[5]))
{
Expand All @@ -1258,7 +1258,7 @@ namespace Js
}
}

if (!JavascriptOperators::IsUndefinedObject(args.Values[6], scriptContext))
if (!JavascriptOperators::IsUndefinedObject(args.Values[6]))
{
if (!JavascriptBoolean::Is(args.Values[6]))
{
Expand Down
2 changes: 1 addition & 1 deletion deps/chakrashim/core/lib/Runtime/Library/JSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ namespace JSON
bool &isFirstMember, bool &isEmpty, Js::Var propertyValue)
{
Js::Var propertyObjectString = Str(propertyName, id, value, propertyValue);
if(!Js::JavascriptOperators::IsUndefinedObject(propertyObjectString, scriptContext))
if(!Js::JavascriptOperators::IsUndefinedObject(propertyObjectString))
{
int slotIndex = 0;
Js::ConcatStringN<4>* tempResult = Js::ConcatStringN<4>::New(this->scriptContext); // We may use 3 or 4 slots.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ namespace Js
RecyclableObject* regexLikeObj = RecyclableObject::FromVar(args[1]);

if (!(callInfo.Flags & CallFlags_New) &&
(callInfo.Count == 2 || JavascriptOperators::IsUndefinedObject(args[2], scriptContext)) &&
(callInfo.Count == 2 || JavascriptOperators::IsUndefinedObject(args[2])) &&
newTarget == JavascriptOperators::GetProperty(regexLikeObj, PropertyIds::constructor, scriptContext))
{
// ES5 15.10.3.1 Called as a function: If pattern R is a regexp object and flags is undefined, then return R unchanged.
Expand All @@ -276,7 +276,7 @@ namespace Js
{
// As per ES 2015 21.2.3.1: If 1st argument is RegExp and 2nd argument is flag then return regexp with same pattern as 1st
// argument and flags supplied by the 2nd argument.
if (!JavascriptOperators::IsUndefinedObject(args[2], scriptContext))
if (!JavascriptOperators::IsUndefinedObject(args[2]))
{
InternalString str = source->GetSource();
pattern = CreatePattern(JavascriptString::NewCopyBuffer(str.GetBuffer(), str.GetLength(), scriptContext),
Expand Down Expand Up @@ -350,7 +350,7 @@ namespace Js
const char16 *szOptions = nullptr;

JavascriptString * strOptions = nullptr;
if (options != nullptr && !JavascriptOperators::IsUndefinedObject(options, scriptContext))
if (options != nullptr && !JavascriptOperators::IsUndefinedObject(options))
{
if (JavascriptString::Is(options))
{
Expand Down Expand Up @@ -587,7 +587,7 @@ namespace Js
const char16 *szOptions = nullptr;

JavascriptString * strOptions = nullptr;
if (callInfo.Count > 2 && !JavascriptOperators::IsUndefinedObject(args[2], scriptContext))
if (callInfo.Count > 2 && !JavascriptOperators::IsUndefinedObject(args[2]))
{
if (JavascriptString::Is(args[2]))
{
Expand Down Expand Up @@ -842,7 +842,7 @@ namespace Js
// However, there doesn't seem to be any reason why "limit" processing can't be pulled above the rest
// in the spec. Therefore, we should see if such a spec update is OK. If not, this would have to be
// moved to its correct place in the code.
uint32 limit = (args.Info.Count < 3 || JavascriptOperators::IsUndefinedObject(args[2], scriptContext))
uint32 limit = (args.Info.Count < 3 || JavascriptOperators::IsUndefinedObject(args[2]))
? UINT_MAX
: JavascriptConversion::ToUInt32(args[2], scriptContext);

Expand Down

0 comments on commit d7d956d

Please sign in to comment.