js/src/jit-test/tests/basic/testBug502914.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 function testBug502914() {
     2     // Assigning a non-function to a function-valued property on trace should
     3     // bump the shape.
     4     function f1() {}
     5     function C() {}
     6     var x = C.prototype = {m: f1};
     7     x.m();  // brand scope
     8     var arr = [new C, new C, new C, x];
     9     try {
    10         for (var i = 0; i < 4; i++) {
    11             arr[i].m = 12;
    12             x.m();  // should throw last time through
    13         }
    14     } catch (exc) {
    15         return exc.constructor.name;
    16     }
    17     return "no exception";
    18 }
    19 assertEq(testBug502914(), "TypeError");

mercurial