js/src/tests/js1_8_1/regress/regress-452498-052.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 #52 From Jason Orendorff
michael@0 26
michael@0 27 // Crash in NoteLValue, called from BindDestructuringVar.
michael@0 28 // NoteLValue assumes pn->pn_lexdef is non-null, but here
michael@0 29 // pn is itself the definition of x.
michael@0 30 for (var [x]=0 in null) ;
michael@0 31
michael@0 32 // This one only crashes when executed from a file.
michael@0 33 // Assertion failure: pn != dn->dn_uses, at ../jsparse.cpp:1131
michael@0 34 for (var f in null)
michael@0 35 ;
michael@0 36 var f = 1;
michael@0 37 (f)
michael@0 38
michael@0 39 // Assertion failure: pnu->pn_cookie == FREE_UPVAR_COOKIE, at ../jsemit.cpp:1815
michael@0 40 // In EmitEnterBlock. x has one use, which is pnu here.
michael@0 41 // pnu is indeed a name, but pnu->pn_cookie is 0.
michael@0 42 try { eval('let (x = 1) { var x; }'); } catch(ex) {}
michael@0 43
michael@0 44 // Assertion failure: cg->upvars.lookup(atom), at ../jsemit.cpp:1992
michael@0 45 // atom="x", upvars is empty.
michael@0 46 (1 for each (x in x));
michael@0 47
michael@0 48 reportCompare(expect, actual, summary);
michael@0 49
michael@0 50 exitFunc ('test');
michael@0 51 }

mercurial