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

Unified Diff: src/v8natives.js

Issue 7475: - Specialized IsClassOf for Number, Boolean, Arguments, and Function. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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/runtime.cc ('K') | « src/runtime.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
===================================================================
--- src/v8natives.js (revision 518)
+++ src/v8natives.js (working copy)
@@ -292,7 +292,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) && %ClassOf(this) !== 'Boolean')
+ if (!IS_BOOLEAN(this) && !%IsBooleanClass(this))
throw new $TypeError('Boolean.prototype.toString is not generic');
return ToString(%_ValueOf(this));
}
@@ -301,7 +301,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) && %ClassOf(this) !== 'Boolean')
+ if (!IS_BOOLEAN(this) && !%IsBooleanClass(this))
throw new $TypeError('Boolean.prototype.valueOf is not generic');
return %_ValueOf(this);
}
@@ -340,7 +340,7 @@
// 'this'. This is not as dictated by ECMA-262.
var number = this;
if (!IS_NUMBER(this)) {
- if (%ClassOf(this) !== 'Number')
+ if (!%IsNumberClass(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);
@@ -370,7 +370,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) && %ClassOf(this) !== 'Number')
+ if (!IS_NUMBER(this) && !%IsNumberClass(this))
throw new $TypeError('Number.prototype.valueOf is not generic');
return %_ValueOf(this);
}
@@ -466,7 +466,7 @@
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) && %ClassOf(func) != 'Function')
+ if (!IS_FUNCTION(func) && !%IsFunctionClass(func))
throw new $TypeError('Function.prototype.toString is not generic');
var source = %FunctionGetSourceCode(func);
« src/runtime.cc ('K') | « src/runtime.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698