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

Unified Diff: test/cctest/compiler/test-run-jsops.cc

Issue 953563002: Implement experimental exponentiation operator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use Number() instead of OrderedNumber() to include NaN Created 5 years, 10 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/typing.cc ('k') | test/mjsunit/harmony/exponentiation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-jsops.cc
diff --git a/test/cctest/compiler/test-run-jsops.cc b/test/cctest/compiler/test-run-jsops.cc
index bb7c239a59bf8fc78212412042596409f5e9b033..8e83e4f270542e4cd5d33b80a20d3cb24b9e34e6 100644
--- a/test/cctest/compiler/test-run-jsops.cc
+++ b/test/cctest/compiler/test-run-jsops.cc
@@ -81,6 +81,20 @@ TEST(BinopModulus) {
}
+TEST(BinopExponentiate) {
+ FLAG_harmony_exponentiation = true;
+ FunctionTester T("(function(a,b) { return a ** b; })");
+
+ T.CheckCall(256, 2, 8);
+ T.CheckCall(T.Val(256), T.Val("2"), T.Val(8));
+ T.CheckCall(T.Val(256), T.Val(2), T.Val("8"));
+ T.CheckCall(T.Val(1), T.Val("256"), T.Val("0"));
+ T.CheckCall(T.nan(), T.Val("3"), T.Val("B"));
+ T.CheckCall(T.Val(0.25), T.Val("2"), T.NewObject("([-2])"));
+ T.CheckCall(T.nan(), T.Val("3"), T.NewObject("({})"));
+}
+
+
TEST(BinopShiftLeft) {
FunctionTester T("(function(a,b) { return a << b; })");
« no previous file with comments | « src/typing.cc ('k') | test/mjsunit/harmony/exponentiation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698