Revision: 20750
Author: [email protected]
Date: Tue Apr 15 08:25:42 2014 UTC
Log: Fix bogus Object.isSealed check in some Array builtins.
[email protected]
Review URL: https://codereview.chromium.org/237253002
http://code.google.com/p/v8/source/detail?r=20750
Added:
/branches/bleeding_edge/test/mjsunit/regress/regress-builtinbust-4.js
Modified:
/branches/bleeding_edge/src/array.js
=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-builtinbust-4.js
Tue Apr 15 08:25:42 2014 UTC
@@ -0,0 +1,16 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var o = { __proto__:Array.prototype, 0:"x" };
+function boomer() { return 0; }
+Object.defineProperty(o, "length", { get:boomer, set:boomer });
+Object.seal(o);
+
+assertDoesNotThrow(function() { o.push(1); });
+assertEquals(0, o.length);
+assertEquals(1, o[0]);
+
+assertDoesNotThrow(function() { o.unshift(2); });
+assertEquals(0, o.length);
+assertEquals(2, o[0]);
=======================================
--- /branches/bleeding_edge/src/array.js Mon Apr 14 11:24:40 2014 UTC
+++ /branches/bleeding_edge/src/array.js Tue Apr 15 08:25:42 2014 UTC
@@ -463,10 +463,6 @@
var n = TO_UINT32(this.length);
var m = %_ArgumentsLength();
- if (m > 0 && ObjectIsSealed(this)) {
- throw MakeTypeError("array_functions_change_sealed",
- ["Array.prototype.push"]);
- }
if (%IsObserved(this))
return ObservedArrayPush.apply(this, arguments);
@@ -649,11 +645,6 @@
var num_arguments = %_ArgumentsLength();
var is_sealed = ObjectIsSealed(this);
- if (num_arguments > 0 && is_sealed) {
- throw MakeTypeError("array_functions_change_sealed",
- ["Array.prototype.unshift"]);
- }
-
if (%IsObserved(this))
return ObservedArrayUnshift.apply(this, arguments);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.