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

Unified Diff: node_modules/vulcanize/node_modules/uglify-js/test/compress/issue-143.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/issue-143.js
diff --git a/node_modules/vulcanize/node_modules/uglify-js/test/compress/issue-143.js b/node_modules/vulcanize/node_modules/uglify-js/test/compress/issue-143.js
new file mode 100644
index 0000000000000000000000000000000000000000..4c79790b07f2d929bf168a7940e6ced8a88e37f6
--- /dev/null
+++ b/node_modules/vulcanize/node_modules/uglify-js/test/compress/issue-143.js
@@ -0,0 +1,48 @@
+/**
+ * There was an incorrect sort behaviour documented in issue #143:
+ * (x = f(…)) <= x → x >= (x = f(…))
+ *
+ * For example, let the equation be:
+ * (a = parseInt('100')) <= a
+ *
+ * If a was an integer and has the value of 99,
+ * (a = parseInt('100')) <= a → 100 <= 100 → true
+ *
+ * When transformed incorrectly:
+ * a >= (a = parseInt('100')) → 99 >= 100 → false
+ */
+
+tranformation_sort_order_equal: {
+ options = {
+ comparisons: true,
+ };
+
+ input: { (a = parseInt('100')) == a }
+ expect: { (a = parseInt('100')) == a }
+}
+
+tranformation_sort_order_unequal: {
+ options = {
+ comparisons: true,
+ };
+
+ input: { (a = parseInt('100')) != a }
+ expect: { (a = parseInt('100')) != a }
+}
+
+tranformation_sort_order_lesser_or_equal: {
+ options = {
+ comparisons: true,
+ };
+
+ input: { (a = parseInt('100')) <= a }
+ expect: { (a = parseInt('100')) <= a }
+}
+tranformation_sort_order_greater_or_equal: {
+ options = {
+ comparisons: true,
+ };
+
+ input: { (a = parseInt('100')) >= a }
+ expect: { (a = parseInt('100')) >= a }
+}

Powered by Google App Engine
This is Rietveld 408576698