// Check that withSourceHook passes URLs, propagates exceptions, and // properly restores the original source hooks.
load(libdir + 'asserts.js');
var log = '';
// Establish an outermost source hook.
withSourceHook(function (url) {
log += 'o';
assertEq(url, 'outer'); return'(function outer() { 3; })';
}, function () {
log += 'O'; // Verify that withSourceHook propagates exceptions thrown by source hooks.
assertThrowsValue(function () { // Establish a source hook that throws.
// properly restores the original source hooksloadlibdir + 'assertsjs');// Establish an outermost source hook. =o;
log += 'm';
assertEq(url, 'middle'); throw'borborygmus'; // middle
}, function () {
log += 'M'; // Establish an innermost source hook that does not throw, // and verify that it is in force.
assertEq(withSourceHook(function (url) {
log += 'i';
assertEq(url, 'inner'); return'(function inner() { 1; })';
}, function () {
=I'
evaluate('function ) {2 }'java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
+ 'java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 // and verify that it is in force.(withSourceHook ()java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
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.