summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/string-spread.js
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2020-07-05 09:27:00 -0700
committerAndreas Kling <kling@serenityos.org>2020-07-06 23:40:35 +0200
commit6d58c48c2fbe2e3ce9b9cfe1dd75a5ccc594f961 (patch)
treea7249b908d2f04f2f5bfcc2fb0af8faa99ef6adc /Libraries/LibJS/Tests/string-spread.js
parente53288824235370608df41354d60b702d71dbc53 (diff)
downloadserenity-6d58c48c2fbe2e3ce9b9cfe1dd75a5ccc594f961.zip
test-js: Use prettier and format all files
Diffstat (limited to 'Libraries/LibJS/Tests/string-spread.js')
-rw-r--r--Libraries/LibJS/Tests/string-spread.js32
1 files changed, 14 insertions, 18 deletions
diff --git a/Libraries/LibJS/Tests/string-spread.js b/Libraries/LibJS/Tests/string-spread.js
index 433aa3b066..cca1ab60bf 100644
--- a/Libraries/LibJS/Tests/string-spread.js
+++ b/Libraries/LibJS/Tests/string-spread.js
@@ -1,31 +1,27 @@
load("test-common.js");
function testArray(arr) {
- return arr.length === 4 &&
- arr[0] === "a" &&
- arr[1] === "b" &&
- arr[2] === "c" &&
- arr[3] === "d";
+ return arr.length === 4 && arr[0] === "a" && arr[1] === "b" && arr[2] === "c" && arr[3] === "d";
}
try {
- var arr;
+ var arr;
- arr = ["a", ..."bc", "d"];
- assert(testArray(arr));
+ arr = ["a", ..."bc", "d"];
+ assert(testArray(arr));
- let s = "bc";
- arr = ["a", ...s, "d"];
- assert(testArray(arr));
+ let s = "bc";
+ arr = ["a", ...s, "d"];
+ assert(testArray(arr));
- let obj = { a: "bc" };
- arr = ["a", ...obj.a, "d"];
- assert(testArray(arr));
+ let obj = { a: "bc" };
+ arr = ["a", ...obj.a, "d"];
+ assert(testArray(arr));
- arr = [..."", ...[...new String("abc")], "d"];
- assert(testArray(arr));
+ arr = [..."", ...[...new String("abc")], "d"];
+ assert(testArray(arr));
- console.log("PASS");
+ console.log("PASS");
} catch (e) {
- console.log("FAIL: " + e);
+ console.log("FAIL: " + e);
}