Index: src/v8natives.js |
=================================================================== |
--- src/v8natives.js (revision 2290) |
+++ src/v8natives.js (working copy) |
@@ -192,7 +192,7 @@ |
// ECMA-262 - 15.2.4.2 |
function ObjectToString() { |
- var c = %ClassOf(this); |
+ var c = %_ClassOf(this); |
// Hide Arguments from the outside. |
if (c === 'Arguments') c = 'Object'; |
return "[object " + c + "]"; |
@@ -311,7 +311,7 @@ |
function BooleanToString() { |
// NOTE: Both Boolean objects and values can enter here as |
// 'this'. This is not as dictated by ECMA-262. |
- if (!IS_BOOLEAN(this) && !%HasBooleanClass(this)) |
+ if (!IS_BOOLEAN(this) && !IS_BOOLEAN_WRAPPER(this)) |
throw new $TypeError('Boolean.prototype.toString is not generic'); |
return ToString(%_ValueOf(this)); |
} |
@@ -320,7 +320,7 @@ |
function BooleanValueOf() { |
// NOTE: Both Boolean objects and values can enter here as |
// 'this'. This is not as dictated by ECMA-262. |
- if (!IS_BOOLEAN(this) && !%HasBooleanClass(this)) |
+ if (!IS_BOOLEAN(this) && !IS_BOOLEAN_WRAPPER(this)) |
throw new $TypeError('Boolean.prototype.valueOf is not generic'); |
return %_ValueOf(this); |
} |
@@ -365,7 +365,7 @@ |
// 'this'. This is not as dictated by ECMA-262. |
var number = this; |
if (!IS_NUMBER(this)) { |
- if (!%HasNumberClass(this)) |
+ if (!IS_NUMBER_WRAPPER(this)) |
throw new $TypeError('Number.prototype.toString is not generic'); |
// Get the value of this number in case it's an object. |
number = %_ValueOf(this); |
@@ -395,7 +395,7 @@ |
function NumberValueOf() { |
// NOTE: Both Number objects and values can enter here as |
// 'this'. This is not as dictated by ECMA-262. |
- if (!IS_NUMBER(this) && !%HasNumberClass(this)) |
+ if (!IS_NUMBER(this) && !IS_NUMBER_WRAPPER(this)) |
throw new $TypeError('Number.prototype.valueOf is not generic'); |
return %_ValueOf(this); |
} |
@@ -502,10 +502,9 @@ |
$Function.prototype.constructor = $Function; |
function FunctionSourceString(func) { |
- // NOTE: Both Function objects and values can enter here as |
- // 'func'. This is not as dictated by ECMA-262. |
- if (!IS_FUNCTION(func) && !%HasFunctionClass(func)) |
+ if (!IS_FUNCTION(func)) { |
throw new $TypeError('Function.prototype.toString is not generic'); |
+ } |
var source = %FunctionGetSourceCode(func); |
if (!IS_STRING(source)) { |