Commit 192d439f authored by ager@chromium.org's avatar ager@chromium.org

Update v8natives to use InstallFunctions to get the correct function

names for library functions.
Review URL: http://codereview.chromium.org/6447

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@433 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4b063df8
......@@ -902,15 +902,6 @@ function ArrayLastIndexOf(element, index) {
// -------------------------------------------------------------------
function InstallFunctions(prototype, attributes, functions) {
for (var i = 0; i < functions.length; i += 2) {
var key = functions[i];
var f = functions[i + 1];
%FunctionSetName(f, key);
%SetProperty(prototype, key, f, attributes);
}
}
function UpdateFunctionLengths(lengths) {
for (var key in lengths) {
......
......@@ -26,6 +26,11 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file relies on the fact that the following declarations have been made
// in v8natives.js:
// const $isNaN = GlobalIsNaN;
// const $isFinite = GlobalIsFinite;
// -------------------------------------------------------------------
// This file contains date support implemented in JavaScript.
......
This diff is collapsed.
......@@ -42,6 +42,12 @@ var arrayPrototypeFunctions = [
TestFunctionNames(Array.prototype, arrayPrototypeFunctions);
// Boolean prototype functions.
var booleanPrototypeFunctions = [ "toString", "valueOf" ];
TestFunctionNames(Boolean.prototype, booleanPrototypeFunctions);
// Date functions.
var dateFunctions = ["UTC", "parse", "now"];
......@@ -65,6 +71,11 @@ var datePrototypeFunctions = [
TestFunctionNames(Date.prototype, datePrototypeFunctions);
// Function.prototype functions.
var functionPrototypeFunctions = [ "toString", "apply", "call" ];
TestFunctionNames(Function.prototype, functionPrototypeFunctions);
// Math functions.
var mathFunctions = [
"random", "abs", "acos", "asin", "atan", "ceil", "cos", "exp", "floor",
......@@ -73,6 +84,21 @@ var mathFunctions = [
TestFunctionNames(Math, mathFunctions);
// Number.prototype functions.
var numberPrototypeFunctions = [
"toString", "toLocaleString", "valueOf", "toFixed", "toExponential",
"toPrecision"];
TestFunctionNames(Number.prototype, numberPrototypeFunctions);
// Object.prototype functions.
var objectPrototypeFunctions = [
"toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf",
"propertyIsEnumerable", "__defineGetter__", "__lookupGetter__",
"__defineSetter__", "__lookupSetter__"];
TestFunctionNames(Object.prototype, objectPrototypeFunctions);
// RegExp.prototype functions.
var regExpPrototypeFunctions = ["exec", "test", "toString", "compile"];
......@@ -101,6 +127,7 @@ var globalFunctions = [
"escape", "unescape", "decodeURI", "decodeURIComponent",
"encodeURI", "encodeURIComponent", "Error", "TypeError",
"RangeError", "SyntaxError", "ReferenceError", "EvalError",
"URIError"];
"URIError", "isNaN", "isFinite", "parseInt", "parseFloat",
"eval", "execScript"];
TestFunctionNames(this, globalFunctions);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment