Source/JavaScriptCore: Implement basic ES6 Math functions
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2013 22:38:05 +0000 (22:38 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2013 22:38:05 +0000 (22:38 +0000)
commita201eea91d97a42782e7fb0961e5d8812ea9df30
treec90e572f7d57ec303afae4f0d30460bb98da3ee1
parentc8c58dd967a48884db5e75070c1b4b364f7f35d2
Source/JavaScriptCore: Implement basic ES6 Math functions
https://bugs.webkit.org/show_bug.cgi?id=123536

Reviewed by Michael Saboff.

Fairly trivial patch to implement the core ES6 Math functions.

This doesn't implement Math.hypot as it is not a trivial function.
I've also skipped Math.sign as I am yet to be convinced the spec
behaviour is good.  Everything else is trivial.

* runtime/MathObject.cpp:
(JSC::MathObject::finishCreation):
(JSC::mathProtoFuncACosh):
(JSC::mathProtoFuncASinh):
(JSC::mathProtoFuncATanh):
(JSC::mathProtoFuncCbrt):
(JSC::mathProtoFuncCosh):
(JSC::mathProtoFuncExpm1):
(JSC::mathProtoFuncFround):
(JSC::mathProtoFuncLog1p):
(JSC::mathProtoFuncLog10):
(JSC::mathProtoFuncLog2):
(JSC::mathProtoFuncSinh):
(JSC::mathProtoFuncTanh):
(JSC::mathProtoFuncTrunc):

Source/WTF: Implement basic ES6 Math functions
https://bugs.webkit.org/show_bug.cgi?id=123536

Reviewed by Michael Saboff.

Add basic implementations of necessary methods to MathExtras to
deal with MSVC not supplying them

* wtf/MathExtras.h:
(asinh):
(acosh):
(atanh):
(expm1):
(log1p):
(cbrt):

LayoutTests: Implement ES6 Math functions
https://bugs.webkit.org/show_bug.cgi?id=123536

Reviewed by Michael Saboff.

Add tests for new math functions

* js/Object-getOwnPropertyNames-expected.txt:
* js/math-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/math.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/Object-getOwnPropertyNames-expected.txt
LayoutTests/js/math-expected.txt
LayoutTests/js/script-tests/Object-getOwnPropertyNames.js
LayoutTests/js/script-tests/math.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/MathObject.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/MathExtras.h