18bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// Copyright 2008 the V8 project authors. All rights reserved. 28bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// Redistribution and use in source and binary forms, with or without 38bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// modification, are permitted provided that the following conditions are 48bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// met: 58bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// 68bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// * Redistributions of source code must retain the above copyright 78bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// notice, this list of conditions and the following disclaimer. 88bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// * Redistributions in binary form must reproduce the above 98bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// copyright notice, this list of conditions and the following 108bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// disclaimer in the documentation and/or other materials provided 118bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// with the distribution. 128bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// * Neither the name of Google Inc. nor the names of its 138bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// contributors may be used to endorse or promote products derived 148bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// from this software without specific prior written permission. 158bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// 168bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 178bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 188bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 198bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 208bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 218bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 228bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 238bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 248bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 258bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 268bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 278bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org 288bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.orgfunction f() { 298bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org try { 308bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org throw "foo"; 318bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org return 7; 328bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org } catch (e) { 338bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org "bar" 348bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org } finally { 358bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org return 42; 368bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org } 378bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org} 388bb60585bafbf81564e6b30fcf18c82615a76f95ager@chromium.org 39a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.orgvar result = f(); 40a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.orgif (result != 42) print("Wrong result: " + result); 41