aboutsummaryrefslogtreecommitdiffstats
path: root/tools/node_modules/expresso/deps/jscoverage/tests/javascript/javascript-destructuring.js
diff options
context:
space:
mode:
authorCliff Brake <cbrake@bec-systems.com>2012-08-17 13:43:14 -0400
committerCliff Brake <cbrake@bec-systems.com>2012-08-17 13:43:14 -0400
commita94e78479793722bc97b8771158d1acee3f55413 (patch)
treebf8f79959febb472513b299df99774de524f5fd1 /tools/node_modules/expresso/deps/jscoverage/tests/javascript/javascript-destructuring.js
parentc11f922b0bfa023a4cf49f26e55aec6a1413344b (diff)
downloadopenembedded-admin-a94e78479793722bc97b8771158d1acee3f55413.tar.gz
add node modules to git
This is now the best practice for deployed apps
Diffstat (limited to 'tools/node_modules/expresso/deps/jscoverage/tests/javascript/javascript-destructuring.js')
-rw-r--r--tools/node_modules/expresso/deps/jscoverage/tests/javascript/javascript-destructuring.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/tools/node_modules/expresso/deps/jscoverage/tests/javascript/javascript-destructuring.js b/tools/node_modules/expresso/deps/jscoverage/tests/javascript/javascript-destructuring.js
new file mode 100644
index 0000000..c8cf4c9
--- /dev/null
+++ b/tools/node_modules/expresso/deps/jscoverage/tests/javascript/javascript-destructuring.js
@@ -0,0 +1,42 @@
+// https://developer.mozilla.org/en/New_in_JavaScript_1.7
+
+[a, b] = [b, a];
+
+function f() {
+ return [1, 2];
+}
+[a, b] = f();
+
+for (let [name, value] in Iterator(obj)) {
+ print(name);
+ print(value);
+}
+
+for each (let {name: n, family: { father: f } } in people) {
+ print(n);
+ print(f);
+}
+
+var [a, , b] = f();
+[,,,] = f();
+
+function g() {
+ var parsedURL = /^(\w+)\:\/\/([^\/]+)\/(.*)$/.exec(url);
+ if (!parsedURL)
+ return null;
+ var [, protocol, fullhost, fullpath] = parsedURL;
+}
+
+function h(a, [b, c], {foo: d, 'bar': e}) {
+ f();
+ g();
+}
+
+x = function([a, b]) a + b;
+
+({x: x0, y: y0}) = point;
+var {x: x0, y: y0} = point;
+let ({x: x0, y: y0} = point) {
+ print(x0);
+ print(y0);
+}