summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/workers/parser/tests/fixtures/expression.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/debugger/src/workers/parser/tests/fixtures/expression.js')
-rw-r--r--devtools/client/debugger/src/workers/parser/tests/fixtures/expression.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/devtools/client/debugger/src/workers/parser/tests/fixtures/expression.js b/devtools/client/debugger/src/workers/parser/tests/fixtures/expression.js
new file mode 100644
index 0000000000..fa80b68add
--- /dev/null
+++ b/devtools/client/debugger/src/workers/parser/tests/fixtures/expression.js
@@ -0,0 +1,25 @@
+const obj = { a: { b: 2 } }; // e.g. obj.a.b
+const foo = obj2.c.secondProperty; // e.g. foo.obj2.c.secondProperty
+
+// computed properties
+const com = { [a]: { b: "c", [d]: "e" }, [b]: 3 }; // e.g. com[a].b
+const firstAuthor = collection.books[1].author;
+const firstActionDirector = collection.genres["sci-fi"].movies[0].director;
+
+app.TodoView = Backbone.extend({
+ render: function() {}
+});
+
+// assignments
+obj.foo = { a: { b: "c" }, b: 3 }; // e.g. obj.foo.a.b
+com = { a: { b: "c" }, b: 3 }; // e.g. com.a.b
+
+// arrays
+const res = [{ a: 2 }, { b: 3 }]; // e.g. res[1].b
+const res2 = { a: [{ b: 2 }] }; // e.g. res.a[0].b
+const res3 = { a: [{ b: 2 }], b: [{ c: 3 }] }; // e.g. res.a[0].b
+const res4 = [[{ a: 3 }], [{ b: a.b.c.v.d }]]; // e.g. res[1][0].b
+
+function params({ a, b }) {} // e.g. a
+var pars = function({ a, b }) {};
+const evil = obj2.doEvil().c.secondProperty; // e.g. obj2.doEvil or ""