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

Unified Diff: test/mjsunit/harmony/modules-html-comments.js

Issue 2009963002: [modules] Disable HTML-like comments Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unify behavior for optimized and non-optimized executions Created 4 years, 7 months 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
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/modules-html-comments.js
diff --git a/test/mjsunit/harmony/modules-html-comments.js b/test/mjsunit/harmony/modules-html-comments.js
new file mode 100644
index 0000000000000000000000000000000000000000..7209d69a724c46f2ad711798f5813afa66023a33
--- /dev/null
+++ b/test/mjsunit/harmony/modules-html-comments.js
@@ -0,0 +1,46 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Flags: --allow-natives-syntax
+//
+// MODULE
+
+var x = 1;
+x --> 0;
+assertEquals(0, x, 'a');
+
+var x = 0; x <!-- x
+assertEquals(-1, x, 'b');
+
+var x = 1; x <!--x
+assertEquals(0, x, 'c');
+
+var x = 2; x <!-- x; x = 42;
+assertEquals(42, x, 'd');
+
+var x = 1; x <! x--;
+assertEquals(0, x, 'e');
+
+var x = 1; x <!- x--;
+assertEquals(0, x, 'f');
+
+var b = true <! true;
+assertFalse(b, 'g');
+
+var b = true <!- true;
+assertFalse(b, 'h');
+
+function f() {
+ var x = 9;
+ x --> 0 && 0 <!-- x;
+ return x;
+}
+
+%DeoptimizeFunction(f);
+
+assertEquals(f(), 7);
+
+%OptimizeFunctionOnNextCall(f);
+
+assertEquals(f(), 7);
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698