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); |