Change 'assert' handle to pass only upon exactly 1 argument is received, and the argument is boolean true; update internal test suite correspondingly.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,12 +12,12 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function test()
|
||||
function test ()
|
||||
{
|
||||
{
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(test());
|
||||
assert (test ());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -29,4 +29,4 @@ switch ("key") {
|
||||
break;
|
||||
}
|
||||
|
||||
assert(matchesCount === 1 ? 1 : 0);
|
||||
assert (matchesCount === 1);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -25,4 +25,4 @@ switch ("key") {
|
||||
++counter;
|
||||
}
|
||||
|
||||
assert(counter == 4 ? 1 : 0);
|
||||
assert (counter == 4);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,16 +12,16 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function test()
|
||||
function test ()
|
||||
{
|
||||
try {
|
||||
if (true) {
|
||||
throw "error";
|
||||
}
|
||||
} catch (e) {
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(test());
|
||||
assert (test ());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,16 +12,16 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function test()
|
||||
function test ()
|
||||
{
|
||||
try {
|
||||
while (true) {
|
||||
throw "error";
|
||||
}
|
||||
} catch (e) {
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(test);
|
||||
assert (test ());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,27 +12,27 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function d() {
|
||||
function d () {
|
||||
throw "exception";
|
||||
}
|
||||
function c() {
|
||||
d();
|
||||
function c () {
|
||||
d ();
|
||||
}
|
||||
function b() {
|
||||
c();
|
||||
function b () {
|
||||
c ();
|
||||
}
|
||||
function a() {
|
||||
b();
|
||||
function a () {
|
||||
b ();
|
||||
}
|
||||
|
||||
function test()
|
||||
function test ()
|
||||
{
|
||||
try {
|
||||
a();
|
||||
a ();
|
||||
} catch (e) {
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(test());
|
||||
assert (test ());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,15 +12,15 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function test()
|
||||
function test ()
|
||||
{
|
||||
try {
|
||||
var x = 1;
|
||||
} catch (e) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
assert(test());
|
||||
assert (test ());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,15 +12,15 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function test()
|
||||
function test ()
|
||||
{
|
||||
try {
|
||||
throw 1;
|
||||
} catch (e) {
|
||||
return e === 1 ? 0 : 1;
|
||||
return (e === 1);
|
||||
}
|
||||
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
assert (test);
|
||||
assert (test ());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,17 +12,17 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function test()
|
||||
function test ()
|
||||
{
|
||||
try {
|
||||
throw "error";
|
||||
} catch (e) {
|
||||
return 1;
|
||||
return false;
|
||||
} finally {
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(test);
|
||||
assert (test ());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,16 +12,16 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function test()
|
||||
function test ()
|
||||
{
|
||||
try {
|
||||
throw "error";
|
||||
} catch (e) {
|
||||
return 1;
|
||||
return true;
|
||||
} finally {
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(test());
|
||||
assert (test ());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -12,15 +12,15 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
function test()
|
||||
function test ()
|
||||
{
|
||||
try {
|
||||
var x = 1;
|
||||
} finally {
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(test());
|
||||
assert (test ());
|
||||
|
||||
Reference in New Issue
Block a user