1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
4 * Any copyright is dedicated to the Public Domain.
5 * http://creativecommons.org/licenses/publicdomain/
9 * If the tracer fails to notice that computeThis() will produce a wrapped
10 * primitive, then we may get:
12 * Assertion failure: thisObj == globalObj
15 var HOTLOOP = this.tracemonkey ? tracemonkey.HOTLOOP : 8;
18 for (var i = 0; i < HOTLOOP; i++)
24 * Various sorts of events can cause the global to be reshaped, which
25 * resets our loop counts. Furthermore, we don't record a branch off a
26 * trace until it has been taken HOTEXIT times. So simply calling the
27 * function twice may not be enough to ensure that the 'a = this' branch
28 * gets recorded. This is probably excessive, but it'll work.
38 assertEq(typeof a, "object");
39 assertEq("" + a, "s");