Index: src/v8natives.js |
=================================================================== |
--- src/v8natives.js (revision 7763) |
+++ src/v8natives.js (working copy) |
@@ -208,20 +208,12 @@ |
// ECMA-262 - 15.2.4.2 |
function ObjectToString() { |
- if (IS_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
- return '[object Undefined]'; |
- } |
- if (IS_NULL(this)) return '[object Null]'; |
return "[object " + %_ClassOf(ToObject(this)) + "]"; |
} |
// ECMA-262 - 15.2.4.3 |
function ObjectToLocaleString() { |
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
- throw MakeTypeError("called_on_null_or_undefined", |
- ["Object.prototype.toLocaleString"]); |
- } |
return this.toString(); |
} |
@@ -240,10 +232,6 @@ |
// ECMA-262 - 15.2.4.6 |
function ObjectIsPrototypeOf(V) { |
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
- throw MakeTypeError("called_on_null_or_undefined", |
- ["Object.prototype.isPrototypeOf"]); |
- } |
if (!IS_SPEC_OBJECT(V)) return false; |
return %IsInPrototypeChain(this, V); |
} |
@@ -1074,10 +1062,6 @@ |
// ECMA-262 section 15.7.4.3 |
function NumberToLocaleString() { |
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
- throw MakeTypeError("called_on_null_or_undefined", |
- ["Number.prototype.toLocaleString"]); |
- } |
return this.toString(); |
} |
@@ -1098,10 +1082,6 @@ |
if (f < 0 || f > 20) { |
throw new $RangeError("toFixed() digits argument must be between 0 and 20"); |
} |
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
- throw MakeTypeError("called_on_null_or_undefined", |
- ["Number.prototype.toFixed"]); |
- } |
var x = ToNumber(this); |
return %NumberToFixed(x, f); |
} |
@@ -1116,10 +1096,6 @@ |
throw new $RangeError("toExponential() argument must be between 0 and 20"); |
} |
} |
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
- throw MakeTypeError("called_on_null_or_undefined", |
- ["Number.prototype.toExponential"]); |
- } |
var x = ToNumber(this); |
return %NumberToExponential(x, f); |
} |
@@ -1127,10 +1103,6 @@ |
// ECMA-262 section 15.7.4.7 |
function NumberToPrecision(precision) { |
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) { |
- throw MakeTypeError("called_on_null_or_undefined", |
- ["Number.prototype.toPrecision"]); |
- } |
if (IS_UNDEFINED(precision)) return ToString(%_ValueOf(this)); |
var p = TO_INTEGER(precision); |
if (p < 1 || p > 21) { |