134064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// Copyright 2008 the V8 project authors. All rights reserved. 234064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// Redistribution and use in source and binary forms, with or without 334064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// modification, are permitted provided that the following conditions are 434064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// met: 534064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// 634064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// * Redistributions of source code must retain the above copyright 734064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// notice, this list of conditions and the following disclaimer. 834064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// * Redistributions in binary form must reproduce the above 934064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// copyright notice, this list of conditions and the following 1034064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// disclaimer in the documentation and/or other materials provided 1134064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// with the distribution. 121975208919a273018a2cda87e765870c5f86d01fChia-I Wu// * Neither the name of Google Inc. nor the names of its 13137c510097503e590cf8b30d2b97e617b9a1543bVinson Lee// contributors may be used to endorse or promote products derived 14edc09358f72cd48cb2315daf23c82e7646aeaea3Vinson Lee// from this software without specific prior written permission. 15137c510097503e590cf8b30d2b97e617b9a1543bVinson Lee// 16137c510097503e590cf8b30d2b97e617b9a1543bVinson Lee// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17137c510097503e590cf8b30d2b97e617b9a1543bVinson Lee// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 181975208919a273018a2cda87e765870c5f86d01fChia-I Wu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 191975208919a273018a2cda87e765870c5f86d01fChia-I Wu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 201975208919a273018a2cda87e765870c5f86d01fChia-I Wu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2134064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2234064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2334064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2434064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2534064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2634064756a5e2c8952c9de26eaebafddabd562540Chia-I Wu// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 271975208919a273018a2cda87e765870c5f86d01fChia-I Wu 281975208919a273018a2cda87e765870c5f86d01fChia-I Wufunction f() { 291975208919a273018a2cda87e765870c5f86d01fChia-I Wu try { 301975208919a273018a2cda87e765870c5f86d01fChia-I Wu throw "foo"; 311975208919a273018a2cda87e765870c5f86d01fChia-I Wu return 7; 321975208919a273018a2cda87e765870c5f86d01fChia-I Wu } finally { 331975208919a273018a2cda87e765870c5f86d01fChia-I Wu return 42; 341975208919a273018a2cda87e765870c5f86d01fChia-I Wu } 351975208919a273018a2cda87e765870c5f86d01fChia-I Wu} 361975208919a273018a2cda87e765870c5f86d01fChia-I Wu 371975208919a273018a2cda87e765870c5f86d01fChia-I Wuvar result = f(); 381975208919a273018a2cda87e765870c5f86d01fChia-I Wuif (result != 42) print("Wrong result: " + result); 391975208919a273018a2cda87e765870c5f86d01fChia-I Wu