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:
Ruben Ayrapetyan
2015-07-30 15:13:16 +03:00
parent 5d385b1144
commit c715a7cd1d
44 changed files with 138 additions and 137 deletions
+7 -6
View File
@@ -113,7 +113,7 @@ read_sources (const char *script_file_names[],
/** /**
* Provide the 'assert' implementation for the engine. * Provide the 'assert' implementation for the engine.
* *
* @return true - if the argument was not a boolean value or it was boolean true. * @return true - if only one argument was passed and the argument is a boolean true.
*/ */
static bool static bool
assert_handler (const jerry_api_object_t *function_obj_p __attr_unused___, /** < function object */ assert_handler (const jerry_api_object_t *function_obj_p __attr_unused___, /** < function object */
@@ -122,18 +122,19 @@ assert_handler (const jerry_api_object_t *function_obj_p __attr_unused___, /** <
const jerry_api_value_t args_p[], /** < function arguments */ const jerry_api_value_t args_p[], /** < function arguments */
const jerry_api_length_t args_cnt) /** < number of function arguments */ const jerry_api_length_t args_cnt) /** < number of function arguments */
{ {
if (args_cnt > 0 if (args_cnt == 1
&& args_p[0].type == JERRY_API_DATA_TYPE_BOOLEAN && args_p[0].type == JERRY_API_DATA_TYPE_BOOLEAN
&& args_p[0].v_bool != true) && args_p[0].v_bool == true)
{
return true;
}
else
{ {
JERRY_ERROR_MSG ("Script assertion failed\n"); JERRY_ERROR_MSG ("Script assertion failed\n");
exit (JERRY_STANDALONE_EXIT_CODE_FAIL); exit (JERRY_STANDALONE_EXIT_CODE_FAIL);
} }
return true;
} /* assert_handler */ } /* assert_handler */
int int
main (int argc, main (int argc,
char **argv) char **argv)
+5 -5
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(test()); assert (test ());
function test(arg) function test (arg)
{ {
if (typeof (arg) === "undefined") if (typeof (arg) === "undefined")
return 1; return true;
else else
return 0; return false;
} }
+5 -5
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(test()); assert (test ());
function test(arg) function test (arg)
{ {
if (typeof (arg) === "undefined") if (typeof (arg) === "undefined")
return 1; return true;
else else
return 0; return false;
} }
+3 -3
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -13,5 +13,5 @@
// limitations under the License. // limitations under the License.
var a = NaN; var a = NaN;
var b = new Object(); var b = new Object ();
assert((!a && b)) assert ((!a && b) === b);
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -15,4 +15,4 @@
var a = 0xffffffff; var a = 0xffffffff;
var _a = a; var _a = a;
var b = 4; var b = 4;
assert(a >>= b === _a >> b) assert ((a >>= b) === (_a >> b));
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -15,4 +15,4 @@
var a = 0xffffffff; var a = 0xffffffff;
var _a = a; var _a = a;
var b = 4; var b = 4;
assert(a <<= b === _a << b) assert ((a <<= b) === (_a << b));
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -15,4 +15,4 @@
var a = 0xffffffff; var a = 0xffffffff;
var _a = a; var _a = a;
var b = 4; var b = 4;
assert(a >>>= b === _a >>> b) assert ((a >>>= b) === (_a >>> b));
+5 -5
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function test() function test ()
{ {
{ {
return 1; return true;
} }
return 0; return false;
} }
assert(test()); assert (test ());
+2 -2
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -29,4 +29,4 @@ switch ("key") {
break; break;
} }
assert(matchesCount === 1 ? 1 : 0); assert (matchesCount === 1);
+2 -2
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -25,4 +25,4 @@ switch ("key") {
++counter; ++counter;
} }
assert(counter == 4 ? 1 : 0); assert (counter == 4);
+5 -5
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function test() function test ()
{ {
try { try {
if (true) { if (true) {
throw "error"; throw "error";
} }
} catch (e) { } catch (e) {
return 1; return true;
} }
return 0; return false;
} }
assert(test()); assert (test ());
+5 -5
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function test() function test ()
{ {
try { try {
while (true) { while (true) {
throw "error"; throw "error";
} }
} catch (e) { } catch (e) {
return 0; return true;
} }
return 1; return false;
} }
assert(test); assert (test ());
+13 -13
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function d() { function d () {
throw "exception"; throw "exception";
} }
function c() { function c () {
d(); d ();
} }
function b() { function b () {
c(); c ();
} }
function a() { function a () {
b(); b ();
} }
function test() function test ()
{ {
try { try {
a(); a ();
} catch (e) { } catch (e) {
return 1; return true;
} }
return 0; return false;
} }
assert(test()); assert (test ());
+5 -5
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function test() function test ()
{ {
try { try {
var x = 1; var x = 1;
} catch (e) { } catch (e) {
return 0; return false;
} }
return 1; return true;
} }
assert(test()); assert (test ());
+5 -5
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function test() function test ()
{ {
try { try {
throw 1; throw 1;
} catch (e) { } catch (e) {
return e === 1 ? 0 : 1; return (e === 1);
} }
return 1; return false;
} }
assert (test); assert (test ());
+6 -6
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function test() function test ()
{ {
try { try {
throw "error"; throw "error";
} catch (e) { } catch (e) {
return 1; return false;
} finally { } finally {
return 0; return true;
} }
return 1; return false;
} }
assert(test); assert (test ());
+5 -5
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function test() function test ()
{ {
try { try {
throw "error"; throw "error";
} catch (e) { } catch (e) {
return 1; return true;
} finally { } finally {
} }
return 0; return false;
} }
assert(test()); assert (test ());
+5 -5
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function test() function test ()
{ {
try { try {
var x = 1; var x = 1;
} finally { } finally {
return 1; return true;
} }
return 0; return false;
} }
assert(test()); assert (test ());
+4 -4
View File
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
function arguments(param) { function arguments (param) {
return 1; return true;
} }
assert(arguments()); assert (arguments ());
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String() === String("") ? 1 : 0); assert (String () === String (""));
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(undefined) === "undefined" ? 1 : 0); assert (String (undefined) === "undefined");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(null) === "null" ? 1 : 0); assert (String (null) === "null");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(true) === "true" ? 1 : 0); assert (String (true) === "true");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(false) === "false" ? 1 : 0); assert (String (false) === "false");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(+0) === "0" ? 1 : 0); assert (String (+0) === "0");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(-0) === "0" ? 1 : 0); assert (String (-0) === "0");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(-1) === "-" + String(1) ? 1 : 0); assert (String (-1) === "-" + String (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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(Infinity) === "Infinity" ? 1 : 0); assert (String (Infinity) === "Infinity");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(123000) === "123000" ? 1 : 0); assert (String (123000) === "123000");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(10000000000000000000) === "10000000000000000000" ? 1 : 0); assert (String (10000000000000000000) === "10000000000000000000");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(0.111111111111111) === "0.111111111111111" ? 1 : 0); assert (String (0.111111111111111) === "0.111111111111111");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(0.00000111111111111111) === "0.00000111111111111111" ? 1 : 0); assert (String (0.00000111111111111111) === "0.00000111111111111111");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String(0.000000111111111111111) === "1.11111111111111e-7" ? 1 : 0); assert (String (0.000000111111111111111) === "1.11111111111111e-7");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,6 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
var s = new String(""); var s = new String ("");
s.x = 1; s.x = 1;
assert((s.x === 1) ? 1 : 0); assert (s.x === 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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String.fromCharCode() === "" ? 1 : 0); assert (String.fromCharCode () === "");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String.fromCharCode(65, 66, 67) === "ABC" ? 1 : 0); assert (String.fromCharCode (65, 66, 67) === "ABC");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert((String.prototype.constructor === String) ? 1 : 0); assert (String.prototype.constructor === String);
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert((String("abc").toString() === "abc") ? 1 : 0); assert (String ("abc").toString () === "abc");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(("abc".toString() === "abc") ? 1 : 0); assert ("abc".toString () === "abc");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String("abc").valueOf() === "abc" ? 1 : 0); assert (String ("abc").valueOf () === "abc");
@@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
assert(String().concat.length === 1 ? 1 : 0); assert (String ().concat.length === 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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -12,6 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
var b = new Boolean(true); var b = new Boolean (true);
b.x = 1; b.x = 1;
assert((b.x === 1) ? 1 : 0); assert (b.x === 1);
+1 -1
View File
@@ -116,7 +116,7 @@ var props = {
var obj3 = Object.create(obj, props); var obj3 = Object.create(obj, props);
assert (obj3.prop1 === 1); assert (obj3.prop1 === 1);
assert (obj3.protoFunction()); assert (obj3.protoFunction() === 3);
try { try {
assert (obj3.hey === undefined); assert (obj3.hey === undefined);
obj3.hey(); obj3.hey();
+1 -1
View File
@@ -18,7 +18,7 @@ assert ("hello".replace("", ":") === ":hello");
assert ("xabcxabcx".replace (/abc/g, "[$&][$`][$']") === "x[abc][x][xabcx]x[abc][xabcx][x]x"); assert ("xabcxabcx".replace (/abc/g, "[$&][$`][$']") === "x[abc][x][xabcx]x[abc][xabcx][x]x");
assert ("abc".replace (/a(b)c|d()/, "[$1][$01][$2][$02][$99][$123][$012]") === "[b][b][][][][3][b2]"); assert ("abc".replace (/a(b)c|d()/, "[$1][$01][$2][$02][$99][$123][$012]") === "[b][b][][][][3][b2]");
assert ("abc".replace("abc", "$x$$5$0$00$" === "$x$5$0$00$")); assert ("abc".replace("abc", "$x$$5$0$00$") === "$x$5$0$00$");
assert ("a true true story".replace(true) === "a undefined true story"); assert ("a true true story".replace(true) === "a undefined true story");
assert ("1234".replace(23, 32) === "1324"); assert ("1234".replace(23, 32) === "1324");