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

Unified Diff: src/runtime.js

Issue 953563002: Implement experimental exponentiation operator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add more tests and fix some bugs 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
« src/compiler/typer.cc ('K') | « src/preparser.h ('k') | src/scanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index 7d82dfa8463fac3305ca98f42dd9a5545444a40c..a67866fc8d20cab42719038a18bd9eff14df0190 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -223,6 +223,14 @@ function MOD(y) {
}
+// ECMA-262, section 11.5.3, page 49.
+function EXP(y) {
+ var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this);
+ if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
+ return %_MathPow(x, y);
+}
+
+
/* -------------------------------------------
- - - B i t o p e r a t i o n s - - -
« src/compiler/typer.cc ('K') | « src/preparser.h ('k') | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698