Index: test/mjsunit/regress/regress-function-length-strict.js |
diff --git a/test/mjsunit/regress/regress-2489.js b/test/mjsunit/regress/regress-function-length-strict.js |
similarity index 82% |
copy from test/mjsunit/regress/regress-2489.js |
copy to test/mjsunit/regress/regress-function-length-strict.js |
index 882c4f794a88e24d1d64e86a466b27c39f51e625..700f34a67ad301e80878fbe7f27fcd5b68794655 100644 |
--- a/test/mjsunit/regress/regress-2489.js |
+++ b/test/mjsunit/regress/regress-function-length-strict.js |
@@ -25,26 +25,17 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
+// Test that the length property of a function is read-only in strict mode. |
"use strict"; |
-function f(a, b) { |
- return g("c", "d"); |
+function foo(a, b, c) { |
+ return b; |
} |
-function g(a, b) { |
- g.constructor.apply(this, arguments); |
-} |
- |
-g.constructor = function(a, b) { |
- assertEquals("c", a); |
- assertEquals("d", b); |
-} |
- |
-f("a", "b"); |
-f("a", "b"); |
-%OptimizeFunctionOnNextCall(f); |
-f("a", "b"); |
-g.x = "deopt"; |
-f("a", "b"); |
+var desc = Object.getOwnPropertyDescriptor(foo, 'length'); |
+assertEquals(3, desc.value); |
+assertFalse(desc.writable); |
+assertFalse(desc.enumerable); |
+assertFalse(desc.configurable); |
+assertThrows(function() { foo.length = 2; }, TypeError); |