From ed784851083eafef29de50b818d693b71a4a2d18 Mon Sep 17 00:00:00 2001 From: MaBecker Date: Thu, 7 Mar 2019 21:26:58 +0100 Subject: [PATCH] add brackets to logical expression (fix #1629) --- tests/test_array_access.js | 4 ++-- tests/test_array_big_indices.js | 4 ++-- tests/test_function_length.js | 4 ++-- tests/test_object_proto.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_array_access.js b/tests/test_array_access.js index c58fd50d25..02cf74137f 100644 --- a/tests/test_array_access.js +++ b/tests/test_array_access.js @@ -1,4 +1,4 @@ // https://github.com/espruino/Espruino/issues/290 var arr = ["a"]; -result = ((arr[true] === undefined) === true) && - ((arr[false] === undefined) === true); +result = (((arr[true] === undefined) === true) && + ((arr[false] === undefined) === true)); diff --git a/tests/test_array_big_indices.js b/tests/test_array_big_indices.js index 8aedeaf670..85cdfd7c3f 100644 --- a/tests/test_array_big_indices.js +++ b/tests/test_array_big_indices.js @@ -9,5 +9,5 @@ objb["1233456789012345"]=true; var rb = JSON.stringify(objb); -result = ra=="{\"1233456789012345\":\"yes\"}" && - rb=="{\"1233456789012345\":true}"; +result = ( ra=="{\"1233456789012345\":\"yes\"}" && + rb=="{\"1233456789012345\":true}" ); diff --git a/tests/test_function_length.js b/tests/test_function_length.js index c5c8a9d6ed..25ec9a48fc 100644 --- a/tests/test_function_length.js +++ b/tests/test_function_length.js @@ -1,8 +1,8 @@ -result = (function () {}).length === 0 && +result = ((function () {}).length === 0 && (function (a) {}).length === 1 && (function (a,b) {}).length === 2 && - (function (a,b,c,d,e,f,g,h) {}).length === 8; + (function (a,b,c,d,e,f,g,h) {})).length === 8; diff --git a/tests/test_object_proto.js b/tests/test_object_proto.js index 213e24434c..f6ab5f2d90 100644 --- a/tests/test_object_proto.js +++ b/tests/test_object_proto.js @@ -1,6 +1,6 @@ // https://github.com/espruino/Espruino/issues/381 -result = +result = ( Array.prototype === [].__proto__ && String.prototype === "".__proto__ && - Number.prototype === (5).__proto__; + Number.prototype === (5).__proto__ );