js/src/tests/js1_8_1/regress/regress-452498-053.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /*
michael@0 3 * Any copyright is dedicated to the Public Domain.
michael@0 4 * http://creativecommons.org/licenses/publicdomain/
michael@0 5 * Contributor: Jason Orendorff
michael@0 6 */
michael@0 7
michael@0 8 //-----------------------------------------------------------------------------
michael@0 9 var BUGNUMBER = 452498;
michael@0 10 var summary = 'TM: upvar2 regression tests';
michael@0 11 var actual = '';
michael@0 12 var expect = '';
michael@0 13
michael@0 14
michael@0 15 //-----------------------------------------------------------------------------
michael@0 16 test();
michael@0 17 //-----------------------------------------------------------------------------
michael@0 18
michael@0 19 function test()
michael@0 20 {
michael@0 21 enterFunc ('test');
michael@0 22 printBugNumber(BUGNUMBER);
michael@0 23 printStatus (summary);
michael@0 24
michael@0 25 // ------- Comment #53 From Jason Orendorff
michael@0 26
michael@0 27 // Assertion failure: (slot) < (uint32_t)(obj)->dslots[-1]
michael@0 28 // at ../jsobj.cpp:5559
michael@0 29 // On the last line of BindLet, we have
michael@0 30 // JS_SetReservedSlot(cx, blockObj, index, PRIVATE_TO_JSVAL(pn));
michael@0 31 // but this uses reserved slots as though they were unlimited.
michael@0 32 // blockObj only has 2.
michael@0 33 let (a=0, b=1, c=2) {}
michael@0 34
michael@0 35 // In RecycleTree at ../jsparse.cpp:315, we hit
michael@0 36 // MOZ_ASSUME_UNREACHABLE("RecycleUseDefKids");
michael@0 37 // pn->pn_type is TOK_UNARYOP
michael@0 38 // pn->pn_op is JSOP_XMLNAME
michael@0 39 // pn->pn_defn is 1
michael@0 40 // pn->pn_used is 1
michael@0 41 try
michael@0 42 {
michael@0 43 true; 0;
michael@0 44 }
michael@0 45 catch(ex)
michael@0 46 {
michael@0 47 }
michael@0 48 // Calls LinkUseToDef with pn->pn_defn == 1.
michael@0 49 //
michael@0 50 // If you say "var x;" first, then run this case, it gets further,
michael@0 51 // crashing in NoteLValue like the first case in comment 52.
michael@0 52 //
michael@0 53 try
michael@0 54 {
michael@0 55 for (var [x] = x in y) var x;
michael@0 56 }
michael@0 57 catch(ex)
michael@0 58 {
michael@0 59 }
michael@0 60 // Assertion failure: !pn2->pn_defn, at ../jsparse.h:461
michael@0 61 // Another case where some optimization is going on.
michael@0 62 try
michael@0 63 {
michael@0 64 if (true && foo) ;
michael@0 65 }
michael@0 66 catch(ex)
michael@0 67 {
michael@0 68 }
michael@0 69 // Assertion failure: scope->object == ctor
michael@0 70 // in js_FastNewObject at ../jsbuiltins.cpp:237
michael@0 71 //
michael@0 72 // With the patch, we're new-ing a different function each time, and the
michael@0 73 // .prototype property is missing.
michael@0 74 //
michael@0 75 for (var z = 0; z < 3; z++) { (new function(){}); }
michael@0 76
michael@0 77 reportCompare(expect, actual, summary);
michael@0 78
michael@0 79 exitFunc ('test');
michael@0 80 }

mercurial