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

Unified Diff: src/v8natives.js

Issue 6223: Make sure that the name accessor on functions return the expected... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 3 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
« no previous file with comments | « src/uri.js ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
===================================================================
--- src/v8natives.js (revision 413)
+++ src/v8natives.js (working copy)
@@ -27,6 +27,7 @@
// This file relies on the fact that the following declarations have been made
+//
// in runtime.js:
// const $Object = global.Object;
// const $Boolean = global.Boolean;
@@ -34,6 +35,9 @@
// const $Function = global.Function;
// const $Array = global.Array;
// const $NaN = 0/0;
+//
+// in math.js:
+// const $floor = MathFloor
// ECMA 262 - 15.1.1.1.
@@ -52,14 +56,14 @@
function $isNaN(number) {
var n = ToNumber(number);
return NUMBER_IS_NAN(n);
-};
+}
%AddProperty(global, "isNaN", $isNaN, DONT_ENUM);
// ECMA 262 - 15.1.5
function $isFinite(number) {
return %NumberIsFinite(ToNumber(number));
-};
+}
%AddProperty(global, "isFinite", $isFinite, DONT_ENUM);
@@ -75,9 +79,9 @@
if (%_IsSmi(string)) return string;
if (IS_NUMBER(string)) {
if (string >= 0.01 && string < 1e9)
- return $Math_floor(string);
+ return $floor(string);
if (string <= -0.01 && string > -1e9)
- return - $Math_floor(-string);
+ return - $floor(-string);
}
} else {
radix = TO_INT32(radix);
@@ -382,7 +386,7 @@
if (source.match(regexp)) source = source.replace(regexp, "$1");
var name = %FunctionGetName(func);
return 'function ' + name + source;
-};
+}
%AddProperty($Function.prototype, "toString", function() {
@@ -413,6 +417,6 @@
var f = %CompileString(source, -1, false)();
%FunctionSetName(f, "anonymous");
return %SetNewFunctionAttributes(f);
-};
+}
%SetCode($Function, NewFunction);
« no previous file with comments | « src/uri.js ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698