From c715a7cd1de6c498420ed024fb03674e5d74754d Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Thu, 30 Jul 2015 15:13:16 +0300 Subject: [PATCH] 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 --- main-linux.cpp | 13 +++++----- tests/jerry-test-suite/08/08.01/08.01-010.js | 10 +++---- tests/jerry-test-suite/08/08.01/08.01-011.js | 10 +++---- tests/jerry-test-suite/11/11.11/11.11-009.js | 6 ++--- .../11/11.13/11.13.02/11.13.02-012.js | 4 +-- .../11/11.13/11.13.02/11.13.02-013.js | 4 +-- .../11/11.13/11.13.02/11.13.02-014.js | 4 +-- tests/jerry-test-suite/12/12.01/12.01-002.js | 10 +++---- tests/jerry-test-suite/12/12.11/12.11-002.js | 4 +-- tests/jerry-test-suite/12/12.11/12.11-004.js | 4 +-- tests/jerry-test-suite/12/12.13/12.13-001.js | 10 +++---- tests/jerry-test-suite/12/12.13/12.13-002.js | 10 +++---- tests/jerry-test-suite/12/12.13/12.13-003.js | 26 +++++++++---------- tests/jerry-test-suite/12/12.14/12.14-002.js | 10 +++---- tests/jerry-test-suite/12/12.14/12.14-003.js | 10 +++---- tests/jerry-test-suite/12/12.14/12.14-004.js | 12 ++++----- tests/jerry-test-suite/12/12.14/12.14-005.js | 10 +++---- tests/jerry-test-suite/12/12.14/12.14-006.js | 10 +++---- tests/jerry-test-suite/13/13.01/13.01-001.js | 8 +++--- .../15.05.01/15.05.01.01/15.05.01.01-001.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-002.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-003.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-004.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-005.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-007.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-008.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-009.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-010.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-011.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-012.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-013.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-014.js | 4 +-- .../15.05.01/15.05.01.01/15.05.01.01-015.js | 4 +-- .../15.05.02/15.05.02.01/15.05.02.01-002.js | 6 ++--- .../15.05.03/15.05.03.02/15.05.03.02-001.js | 4 +-- .../15.05.03/15.05.03.02/15.05.03.02-002.js | 4 +-- .../15.05.04/15.05.04.01/15.05.04.01-001.js | 4 +-- .../15.05.04/15.05.04.02/15.05.04.02-001.js | 4 +-- .../15.05.04/15.05.04.02/15.05.04.02-002.js | 4 +-- .../15.05.04/15.05.04.03/15.05.04.03-001.js | 4 +-- .../15.05.04/15.05.04.06/15.05.04.06-004.js | 4 +-- .../15.06.02/15.06.02.01/15.06.02.01-002.js | 6 ++--- tests/jerry/object-create.js | 2 +- tests/jerry/string-prototype-replace.js | 2 +- 44 files changed, 138 insertions(+), 137 deletions(-) diff --git a/main-linux.cpp b/main-linux.cpp index a8fd1577b..a5f741887 100644 --- a/main-linux.cpp +++ b/main-linux.cpp @@ -113,7 +113,7 @@ read_sources (const char *script_file_names[], /** * 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 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_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].v_bool != true) + && args_p[0].v_bool == true) + { + return true; + } + else { JERRY_ERROR_MSG ("Script assertion failed\n"); exit (JERRY_STANDALONE_EXIT_CODE_FAIL); } - - return true; } /* assert_handler */ - int main (int argc, char **argv) diff --git a/tests/jerry-test-suite/08/08.01/08.01-010.js b/tests/jerry-test-suite/08/08.01/08.01-010.js index 5495fa118..a22274b26 100644 --- a/tests/jerry-test-suite/08/08.01/08.01-010.js +++ b/tests/jerry-test-suite/08/08.01/08.01-010.js @@ -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. -assert(test()); +assert (test ()); -function test(arg) +function test (arg) { if (typeof (arg) === "undefined") - return 1; + return true; else - return 0; + return false; } diff --git a/tests/jerry-test-suite/08/08.01/08.01-011.js b/tests/jerry-test-suite/08/08.01/08.01-011.js index 5495fa118..a22274b26 100644 --- a/tests/jerry-test-suite/08/08.01/08.01-011.js +++ b/tests/jerry-test-suite/08/08.01/08.01-011.js @@ -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. -assert(test()); +assert (test ()); -function test(arg) +function test (arg) { if (typeof (arg) === "undefined") - return 1; + return true; else - return 0; + return false; } diff --git a/tests/jerry-test-suite/11/11.11/11.11-009.js b/tests/jerry-test-suite/11/11.11/11.11-009.js index 813a56f83..8aba32e06 100644 --- a/tests/jerry-test-suite/11/11.11/11.11-009.js +++ b/tests/jerry-test-suite/11/11.11/11.11-009.js @@ -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. @@ -13,5 +13,5 @@ // limitations under the License. var a = NaN; -var b = new Object(); -assert((!a && b)) \ No newline at end of file +var b = new Object (); +assert ((!a && b) === b); diff --git a/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-012.js b/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-012.js index 40e207e5e..02a84dc15 100644 --- a/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-012.js +++ b/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-012.js @@ -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. @@ -15,4 +15,4 @@ var a = 0xffffffff; var _a = a; var b = 4; -assert(a >>= b === _a >> b) \ No newline at end of file +assert ((a >>= b) === (_a >> b)); diff --git a/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-013.js b/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-013.js index 7fc558199..baa652446 100644 --- a/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-013.js +++ b/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-013.js @@ -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. @@ -15,4 +15,4 @@ var a = 0xffffffff; var _a = a; var b = 4; -assert(a <<= b === _a << b) \ No newline at end of file +assert ((a <<= b) === (_a << b)); diff --git a/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-014.js b/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-014.js index aed074751..b4d7955d0 100644 --- a/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-014.js +++ b/tests/jerry-test-suite/11/11.13/11.13.02/11.13.02-014.js @@ -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. @@ -15,4 +15,4 @@ var a = 0xffffffff; var _a = a; var b = 4; -assert(a >>>= b === _a >>> b) \ No newline at end of file +assert ((a >>>= b) === (_a >>> b)); diff --git a/tests/jerry-test-suite/12/12.01/12.01-002.js b/tests/jerry-test-suite/12/12.01/12.01-002.js index c7931fbec..baa9841c6 100644 --- a/tests/jerry-test-suite/12/12.01/12.01-002.js +++ b/tests/jerry-test-suite/12/12.01/12.01-002.js @@ -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 ()); diff --git a/tests/jerry-test-suite/12/12.11/12.11-002.js b/tests/jerry-test-suite/12/12.11/12.11-002.js index 8601c79e0..6547a674c 100644 --- a/tests/jerry-test-suite/12/12.11/12.11-002.js +++ b/tests/jerry-test-suite/12/12.11/12.11-002.js @@ -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); diff --git a/tests/jerry-test-suite/12/12.11/12.11-004.js b/tests/jerry-test-suite/12/12.11/12.11-004.js index 20d997575..ba9ff6901 100644 --- a/tests/jerry-test-suite/12/12.11/12.11-004.js +++ b/tests/jerry-test-suite/12/12.11/12.11-004.js @@ -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); diff --git a/tests/jerry-test-suite/12/12.13/12.13-001.js b/tests/jerry-test-suite/12/12.13/12.13-001.js index f5c88ed15..cd515d6ed 100644 --- a/tests/jerry-test-suite/12/12.13/12.13-001.js +++ b/tests/jerry-test-suite/12/12.13/12.13-001.js @@ -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()); \ No newline at end of file +assert (test ()); diff --git a/tests/jerry-test-suite/12/12.13/12.13-002.js b/tests/jerry-test-suite/12/12.13/12.13-002.js index e27299867..ba29cc8ec 100644 --- a/tests/jerry-test-suite/12/12.13/12.13-002.js +++ b/tests/jerry-test-suite/12/12.13/12.13-002.js @@ -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); \ No newline at end of file +assert (test ()); diff --git a/tests/jerry-test-suite/12/12.13/12.13-003.js b/tests/jerry-test-suite/12/12.13/12.13-003.js index b61eef364..22ec518f9 100644 --- a/tests/jerry-test-suite/12/12.13/12.13-003.js +++ b/tests/jerry-test-suite/12/12.13/12.13-003.js @@ -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()); \ No newline at end of file +assert (test ()); diff --git a/tests/jerry-test-suite/12/12.14/12.14-002.js b/tests/jerry-test-suite/12/12.14/12.14-002.js index 815997ff0..ddf8d2726 100644 --- a/tests/jerry-test-suite/12/12.14/12.14-002.js +++ b/tests/jerry-test-suite/12/12.14/12.14-002.js @@ -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 ()); diff --git a/tests/jerry-test-suite/12/12.14/12.14-003.js b/tests/jerry-test-suite/12/12.14/12.14-003.js index 479e2f2f8..b05f18921 100644 --- a/tests/jerry-test-suite/12/12.14/12.14-003.js +++ b/tests/jerry-test-suite/12/12.14/12.14-003.js @@ -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); \ No newline at end of file +assert (test ()); diff --git a/tests/jerry-test-suite/12/12.14/12.14-004.js b/tests/jerry-test-suite/12/12.14/12.14-004.js index 530c33954..2f7562b51 100644 --- a/tests/jerry-test-suite/12/12.14/12.14-004.js +++ b/tests/jerry-test-suite/12/12.14/12.14-004.js @@ -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); \ No newline at end of file +assert (test ()); diff --git a/tests/jerry-test-suite/12/12.14/12.14-005.js b/tests/jerry-test-suite/12/12.14/12.14-005.js index f6a3c218e..c2dbabf46 100644 --- a/tests/jerry-test-suite/12/12.14/12.14-005.js +++ b/tests/jerry-test-suite/12/12.14/12.14-005.js @@ -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 ()); diff --git a/tests/jerry-test-suite/12/12.14/12.14-006.js b/tests/jerry-test-suite/12/12.14/12.14-006.js index 28931d6a7..8c3b4a881 100644 --- a/tests/jerry-test-suite/12/12.14/12.14-006.js +++ b/tests/jerry-test-suite/12/12.14/12.14-006.js @@ -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 ()); diff --git a/tests/jerry-test-suite/13/13.01/13.01-001.js b/tests/jerry-test-suite/13/13.01/13.01-001.js index 145fa1ab8..56bc06872 100644 --- a/tests/jerry-test-suite/13/13.01/13.01-001.js +++ b/tests/jerry-test-suite/13/13.01/13.01-001.js @@ -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,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -function arguments(param) { - return 1; +function arguments (param) { + return true; } -assert(arguments()); +assert (arguments ()); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-001.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-001.js index e7ea56ee1..986775038 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-001.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-001.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String() === String("") ? 1 : 0); +assert (String () === String ("")); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-002.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-002.js index e43b63c51..26411d15a 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-002.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-002.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(undefined) === "undefined" ? 1 : 0); \ No newline at end of file +assert (String (undefined) === "undefined"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-003.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-003.js index 099010c10..64e1de6fc 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-003.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-003.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(null) === "null" ? 1 : 0); +assert (String (null) === "null"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-004.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-004.js index 09b94ab82..45eb61988 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-004.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-004.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(true) === "true" ? 1 : 0); +assert (String (true) === "true"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-005.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-005.js index 58b5cebf1..3edac6096 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-005.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-005.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(false) === "false" ? 1 : 0); +assert (String (false) === "false"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-007.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-007.js index f1c2b39be..d81f29164 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-007.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-007.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(+0) === "0" ? 1 : 0); +assert (String (+0) === "0"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-008.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-008.js index de016b042..4ab79254b 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-008.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-008.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(-0) === "0" ? 1 : 0); +assert (String (-0) === "0"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-009.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-009.js index 8919c1526..28dc66905 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-009.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-009.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(-1) === "-" + String(1) ? 1 : 0); +assert (String (-1) === "-" + String (1)); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-010.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-010.js index 1bdbc8111..e307cf67b 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-010.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-010.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(Infinity) === "Infinity" ? 1 : 0); +assert (String (Infinity) === "Infinity"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-011.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-011.js index 301f80292..a57f94d00 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-011.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-011.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(123000) === "123000" ? 1 : 0); \ No newline at end of file +assert (String (123000) === "123000"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-012.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-012.js index b79fb7d11..3e5405a06 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-012.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-012.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(10000000000000000000) === "10000000000000000000" ? 1 : 0); \ No newline at end of file +assert (String (10000000000000000000) === "10000000000000000000"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-013.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-013.js index 3685d9f46..96f522cc0 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-013.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-013.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(0.111111111111111) === "0.111111111111111" ? 1 : 0); \ No newline at end of file +assert (String (0.111111111111111) === "0.111111111111111"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-014.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-014.js index db5dba941..563717f47 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-014.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-014.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(0.00000111111111111111) === "0.00000111111111111111" ? 1 : 0); +assert (String (0.00000111111111111111) === "0.00000111111111111111"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-015.js b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-015.js index 00caad20c..c36fad6c6 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-015.js +++ b/tests/jerry-test-suite/15/15.05/15.05.01/15.05.01.01/15.05.01.01-015.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String(0.000000111111111111111) === "1.11111111111111e-7" ? 1 : 0); +assert (String (0.000000111111111111111) === "1.11111111111111e-7"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-002.js b/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-002.js index 441dd5f61..3b4321462 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-002.js +++ b/tests/jerry-test-suite/15/15.05/15.05.02/15.05.02.01/15.05.02.01-002.js @@ -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,6 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -var s = new String(""); +var s = new String (""); s.x = 1; -assert((s.x === 1) ? 1 : 0); +assert (s.x === 1); diff --git a/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-001.js b/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-001.js index 761412a2a..1ec95f40a 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-001.js +++ b/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-001.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String.fromCharCode() === "" ? 1 : 0); +assert (String.fromCharCode () === ""); diff --git a/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-002.js b/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-002.js index ffb5b35ab..bdd457480 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-002.js +++ b/tests/jerry-test-suite/15/15.05/15.05.03/15.05.03.02/15.05.03.02-002.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String.fromCharCode(65, 66, 67) === "ABC" ? 1 : 0); +assert (String.fromCharCode (65, 66, 67) === "ABC"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.01/15.05.04.01-001.js b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.01/15.05.04.01-001.js index 94fc96bf7..f4d938954 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.01/15.05.04.01-001.js +++ b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.01/15.05.04.01-001.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert((String.prototype.constructor === String) ? 1 : 0); \ No newline at end of file +assert (String.prototype.constructor === String); diff --git a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-001.js b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-001.js index da4edf717..00762c05d 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-001.js +++ b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-001.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert((String("abc").toString() === "abc") ? 1 : 0); \ No newline at end of file +assert (String ("abc").toString () === "abc"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-002.js b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-002.js index afca5ab50..641b26f89 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-002.js +++ b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.02/15.05.04.02-002.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(("abc".toString() === "abc") ? 1 : 0); +assert ("abc".toString () === "abc"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.03/15.05.04.03-001.js b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.03/15.05.04.03-001.js index 01271316f..440a95f7d 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.03/15.05.04.03-001.js +++ b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.03/15.05.04.03-001.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String("abc").valueOf() === "abc" ? 1 : 0); \ No newline at end of file +assert (String ("abc").valueOf () === "abc"); diff --git a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-004.js b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-004.js index 952783494..fe26c2af1 100644 --- a/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-004.js +++ b/tests/jerry-test-suite/15/15.05/15.05.04/15.05.04.06/15.05.04.06-004.js @@ -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,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -assert(String().concat.length === 1 ? 1 : 0); +assert (String ().concat.length === 1); diff --git a/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-002.js b/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-002.js index 2d9016827..6f2391992 100644 --- a/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-002.js +++ b/tests/jerry-test-suite/15/15.06/15.06.02/15.06.02.01/15.06.02.01-002.js @@ -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,6 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -var b = new Boolean(true); +var b = new Boolean (true); b.x = 1; -assert((b.x === 1) ? 1 : 0); +assert (b.x === 1); diff --git a/tests/jerry/object-create.js b/tests/jerry/object-create.js index a98fc6a08..5bd42f960 100644 --- a/tests/jerry/object-create.js +++ b/tests/jerry/object-create.js @@ -116,7 +116,7 @@ var props = { var obj3 = Object.create(obj, props); assert (obj3.prop1 === 1); -assert (obj3.protoFunction()); +assert (obj3.protoFunction() === 3); try { assert (obj3.hey === undefined); obj3.hey(); diff --git a/tests/jerry/string-prototype-replace.js b/tests/jerry/string-prototype-replace.js index f646df50c..3b9d5d56e 100644 --- a/tests/jerry/string-prototype-replace.js +++ b/tests/jerry/string-prototype-replace.js @@ -18,7 +18,7 @@ assert ("hello".replace("", ":") === ":hello"); 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("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 ("1234".replace(23, 32) === "1324");