Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: node_modules/vulcanize/node_modules/uglify-js/test/compress/properties.js

Issue 800513006: Added vulcanize under third_party/npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: node_modules/vulcanize/node_modules/uglify-js/test/compress/properties.js
diff --git a/node_modules/vulcanize/node_modules/uglify-js/test/compress/properties.js b/node_modules/vulcanize/node_modules/uglify-js/test/compress/properties.js
new file mode 100644
index 0000000000000000000000000000000000000000..39470738462e4844eeffe1ddf8993b3a67cb1167
--- /dev/null
+++ b/node_modules/vulcanize/node_modules/uglify-js/test/compress/properties.js
@@ -0,0 +1,74 @@
+keep_properties: {
+ options = {
+ properties: false
+ };
+ input: {
+ a["foo"] = "bar";
+ }
+ expect: {
+ a["foo"] = "bar";
+ }
+}
+
+dot_properties: {
+ options = {
+ properties: true
+ };
+ input: {
+ a["foo"] = "bar";
+ a["if"] = "if";
+ a["*"] = "asterisk";
+ a["\u0EB3"] = "unicode";
+ a[""] = "whitespace";
+ a["1_1"] = "foo";
+ }
+ expect: {
+ a.foo = "bar";
+ a["if"] = "if";
+ a["*"] = "asterisk";
+ a["\u0EB3"] = "unicode";
+ a[""] = "whitespace";
+ a["1_1"] = "foo";
+ }
+}
+
+dot_properties_es5: {
+ options = {
+ properties: true,
+ screw_ie8: true
+ };
+ input: {
+ a["foo"] = "bar";
+ a["if"] = "if";
+ a["*"] = "asterisk";
+ a["\u0EB3"] = "unicode";
+ a[""] = "whitespace";
+ }
+ expect: {
+ a.foo = "bar";
+ a.if = "if";
+ a["*"] = "asterisk";
+ a["\u0EB3"] = "unicode";
+ a[""] = "whitespace";
+ }
+}
+
+evaluate_length: {
+ options = {
+ properties: true,
+ unsafe: true,
+ evaluate: true
+ };
+ input: {
+ a = "foo".length;
+ a = ("foo" + "bar")["len" + "gth"];
+ a = b.length;
+ a = ("foo" + b).length;
+ }
+ expect: {
+ a = 3;
+ a = 6;
+ a = b.length;
+ a = ("foo" + b).length;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698