Chromium Code Reviews| Index: src/js/array.js |
| diff --git a/src/js/array.js b/src/js/array.js |
| index d9b097c84727e2aa7beb843b8895b46f25d85cd8..1406df336d03825cb8dac8f47abd0abd2f058323 100644 |
| --- a/src/js/array.js |
| +++ b/src/js/array.js |
| @@ -1049,7 +1049,7 @@ function InnerArraySort(array, length, comparefn) { |
| var CopyFromPrototype = function CopyFromPrototype(obj, length) { |
| var max = 0; |
| for (var proto = %_GetPrototype(obj); proto; proto = %_GetPrototype(proto)) { |
| - var indices = %GetArrayKeys(proto, length); |
| + var indices = IS_PROXY(proto) ? length : %GetArrayKeys(proto, length); |
|
Camillo Bruni
2016/03/29 11:34:57
aah quelle elegance!
|
| if (IS_NUMBER(indices)) { |
| // It's an interval. |
| var proto_length = indices; |
| @@ -1077,7 +1077,7 @@ function InnerArraySort(array, length, comparefn) { |
| // elements in that range. |
| var ShadowPrototypeElements = function(obj, from, to) { |
| for (var proto = %_GetPrototype(obj); proto; proto = %_GetPrototype(proto)) { |
| - var indices = %GetArrayKeys(proto, to); |
| + var indices = IS_PROXY(proto) ? to : %GetArrayKeys(proto, to); |
| if (IS_NUMBER(indices)) { |
| // It's an interval. |
| var proto_length = indices; |