# HG changeset patch # User Claus Gittinger # Date 1226437129 -3600 # Node ID efd32656acce55f430a7c8372a4590a048867650 # Parent 618883cca24a586ca5a8e56ce5f8ba403d37826d changed #testTryCatchFinally01 diff -r 618883cca24a -r efd32656acce RegressionTests__JavaScriptTests.st --- a/RegressionTests__JavaScriptTests.st Tue Nov 11 17:04:04 2008 +0100 +++ b/RegressionTests__JavaScriptTests.st Tue Nov 11 21:58:49 2008 +0100 @@ -3934,6 +3934,34 @@ " ! +testTryCatchFinally01 + self + execute:'test(arg) { + var handlerWasCalled = false; + var finallyExecuted = false; + + function failingMethod() { return 10 / arg; }; + function exceptionRaised() { handlerWasCalled = true; }; + + try { + failingMethod(); + } catch (Error e) { + exceptionRaised(e); + } finally { + finallyExecuted = true; + } + return handlerWasCalled && finallyExecuted; + }' + for:nil + arguments:#(0) + expect:true + + " + self run:#testTryCatchFinally01 + self new testTryCatchFinally01 + " +! + testTryFinally01 self execute:'test(arg) {