Skip to content

Commit

Permalink
Fix incorrect code
Browse files Browse the repository at this point in the history
  • Loading branch information
ShortDevelopment authored and rhuanjl committed Apr 23, 2024
1 parent 76d058f commit 1a03ab0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions test/Array/array_splice.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -121,7 +122,7 @@ try
}
catch(e)
{
if (!e instanceof TypeError) throw(e);
if (!(e instanceof TypeError)) throw(e);
WScript.Echo(y);
WScript.Echo(x);
}
Expand All @@ -132,7 +133,7 @@ try
}
catch(e)
{
if (!e instanceof TypeError) throw(e);
if (!(e instanceof TypeError)) throw(e);
WScript.Echo(y);
WScript.Echo(x);
}
Expand All @@ -143,7 +144,7 @@ try
}
catch(e)
{
if (!e instanceof TypeError) throw(e);
if (!(e instanceof TypeError)) throw(e);
WScript.Echo(y);
WScript.Echo(x);
}
Expand Down
7 changes: 4 additions & 3 deletions test/Array/array_splice_double.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -121,7 +122,7 @@ try
}
catch(e)
{
if (!e instanceof TypeError) throw(e);
if (!(e instanceof TypeError)) throw(e);
WScript.Echo(y);
WScript.Echo(x);
}
Expand All @@ -132,7 +133,7 @@ try
}
catch(e)
{
if (!e instanceof TypeError) throw(e);
if (!(e instanceof TypeError)) throw(e);
WScript.Echo(y);
WScript.Echo(x);
}
Expand All @@ -143,7 +144,7 @@ try
}
catch(e)
{
if (!e instanceof TypeError) throw(e);
if (!(e instanceof TypeError)) throw(e);
WScript.Echo(y);
WScript.Echo(x);
}
Expand Down
3 changes: 2 additions & 1 deletion test/es5/RegExpStrictDelete.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

Expand All @@ -22,7 +23,7 @@ for (var i = 0, len = props.length; i < len; i++)
}
catch (err)
{
if (!err instanceof TypeError)
if (!(err instanceof TypeError))
WScript.Echo("Error: strict delete threw a non-TypeError: " + err);
}
}

0 comments on commit 1a03ab0

Please sign in to comment.