JavaScript: Open-source extractor.

This commit is contained in:
Max Schaefer
2018-11-06 08:25:02 +00:00
parent e03b4f0cb6
commit 4c4920c3a9
992 changed files with 134506 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
[for (year of years) if (year > 2000) year];
year;
[for (i of numbers) for (j of letters) i+j];
[for (i of numbers) for (j of letters) if (i<j) i+j];

View File

@@ -0,0 +1,8 @@
var sum = 0;
var obj = {prop1: 5, prop2: 13, prop3: 8};
for each (var item in obj) {
sum += item;
}
console.log(sum); // logs "26", which is 5+13+8

View File

@@ -0,0 +1,4 @@
(for (year of years) if (year > 2000) year);
year;
(for (i of numbers) for (j of letters) i+j);
(for (i of numbers) for (j of letters) if (i<j) i+j);

View File

@@ -0,0 +1,9 @@
function f(g) {
try {
g();
} catch (e if e instanceof Error) {
console.log("error!");
} catch (e) {
console.log("something else!");
}
}

View File

@@ -0,0 +1,5 @@
var x = 42, y = 19;
console.log(let (x = 23, y = 19) x + y);
console.log(x - y);

View File

@@ -0,0 +1,7 @@
var x = 42, y = 19;
let (x = 23, y = 19) {
console.log(x + y);
}
console.log(x - y);

View File

@@ -0,0 +1 @@
let (x = 0) 1

View File

@@ -0,0 +1,6 @@
// `new` with initializer
new A() { foo: "bar" }
// `new` followed by an empty block
new A()
{}

View File

@@ -0,0 +1,4 @@
function test() {
arguments;
let (arguments);
}