1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/bin/java bsh.Interpreter
source("TestHarness.bsh");
ignore() {
invoke( method, args ) {
return 5;
}
// Special case: direct invocation in scope is not handled
// now we do allow it...
//assert( isEvalError("nomethod()") );
assert( !isEvalError("nomethod()") );
return this;
}
donotignore() {
return this;
}
assert( ignore().nomethod() == 5 );
assert( isEvalError("donotignore().nomethod()") );
// Ignore globally
invoke( method, args ) {
return 42;
}
// inherited, this should work now
assert( !isEvalError("donotignore().nomethod()") );
// Special case: direct invocation in scope is not handled
// now we do allow it
//assert( isEvalError("nomethod()") );
// Special case: direct invocation in scope is not handled
assert( !isEvalError("nomethod()") );
complete();
|