1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_5/extensions/Number-toSource.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,17 @@ 1.4 +/* 1.5 + * Any copyright is dedicated to the Public Domain. 1.6 + * http://creativecommons.org/licenses/publicdomain/ 1.7 + */ 1.8 + 1.9 +assertEq(raisesException(TypeError)('Number.prototype.toSource.call("")'), true); 1.10 +assertEq(raisesException(TypeError)('Number.prototype.toSource.call(true)'), true); 1.11 +assertEq(raisesException(TypeError)('Number.prototype.toSource.call({})'), true); 1.12 +assertEq(raisesException(TypeError)('Number.prototype.toSource.call(null)'), true); 1.13 +assertEq(raisesException(TypeError)('Number.prototype.toSource.call([])'), true); 1.14 +assertEq(raisesException(TypeError)('Number.prototype.toSource.call(undefined)'), true); 1.15 +assertEq(raisesException(TypeError)('Number.prototype.toSource.call(new Boolean(true))'), true); 1.16 + 1.17 +assertEq(completesNormally('Number.prototype.toSource.call(42)'), true); 1.18 +assertEq(completesNormally('Number.prototype.toSource.call(new Number(42))'), true); 1.19 + 1.20 +reportCompare(true, true);