From f910052543d56c073bdcff736980f84f492dbcc4 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Fri, 19 Oct 2012 12:30:18 +0000 Subject: [PATCH] Always invoke the default Array.sort functions from builtin functions, part 2. R=vegorov@chromium.org BUG=v8:2372 Review URL: https://chromiumcodereview.appspot.com/11175007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12774 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/array.js | 2 +- test/mjsunit/regress/regress-builtin-array-op.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/array.js b/src/array.js index ab68c58..250c30c 100644 --- a/src/array.js +++ b/src/array.js @@ -62,7 +62,7 @@ function GetSortedArrayKeys(array, intervals) { } } } - ArraySort.call(keys, function(a, b) { return a - b; }); + %_CallFunction(keys, function(a, b) { return a - b; }, ArraySort); return keys; } diff --git a/test/mjsunit/regress/regress-builtin-array-op.js b/test/mjsunit/regress/regress-builtin-array-op.js index 2ea84d3..1e37af3 100644 --- a/test/mjsunit/regress/regress-builtin-array-op.js +++ b/test/mjsunit/regress/regress-builtin-array-op.js @@ -29,7 +29,8 @@ // array operations. var foo = "hest"; -Array.prototype.sort = function(fn) { foo = "fisk"; } +Array.prototype.sort = function(fn) { foo = "fisk"; }; +Function.prototype.call = function() { foo = "caramel"; }; var a = [2,3,1]; a[100000] = 0; a.join(); -- 2.7.4