// Given a string of letters |expected|, say "abc", assert that the stack // contains calls to a series of functions named by the next letter from // the string, say a, b, and then c. Younger frames appear earlier in // |expected| than older frames. function check(expected, stack) {
print("check(" + JSON.stringify(expected) + ") against:\n" + stack);
count++;
// Extract only the function names from the stack trace. Omit the frames // for the top-level evaluation, if it is present. var split = stack.split(/(.)?@.*\n/).slice(0, -1); if (split[split.length - 1] === undefined)
split = split.slice(0, -2);
// Check the function names against the expected sequence.
assertEq(split.length, expected.length * 2); for (var i = 0; i < expected.length; i++)
assertEq(split[i * 2 + 1], expected[i]);
}
var low = newGlobal({ principal: 0 }); var mid = newGlobal({ principal: 0xffff }); var high = newGlobal({ principal: 0xfffff });
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.