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

Unified Diff: test/mjsunit/es6/symbols.js

Issue 1125783002: [es6] When comparing two symbols we may need to throw a TypeError (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « src/x87/code-stubs-x87.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/symbols.js
diff --git a/test/mjsunit/es6/symbols.js b/test/mjsunit/es6/symbols.js
index 46c3daba8a177c6dce414b1efe6e1c334e2aa147..7203f67a87ca6a5229c03169e2986d5712f9608d 100644
--- a/test/mjsunit/es6/symbols.js
+++ b/test/mjsunit/es6/symbols.js
@@ -504,3 +504,33 @@ function TestGetOwnPropertySymbolsOnPrimitives() {
assertEquals(Object.getOwnPropertySymbols("OK"), []);
}
TestGetOwnPropertySymbolsOnPrimitives();
+
+
+function TestComparison() {
+ function f() {
+ var a = Symbol();
+ a < a;
+ a > a;
+ a <= a;
+ a >= a;
+ }
+
+ assertThrows(f, TypeError);
+ %OptimizeFunctionOnNextCall(f);
+ assertThrows(f, TypeError);
+ assertThrows(f, TypeError);
+
+ function g() {
+ var a = Symbol();
+ var b = Symbol();
+ a < b;
+ a > b;
+ a <= b;
+ a >= b;
+ }
+ assertThrows(g, TypeError);
+ %OptimizeFunctionOnNextCall(g);
+ assertThrows(g, TypeError);
+ assertThrows(g, TypeError);
+}
+TestComparison();
« no previous file with comments | « src/x87/code-stubs-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698