// Copyright 2016 the V8 project authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.// Flags: --allow-natives-syntaxvardothrow=false;functiong(){if(dothrow)throw1;}functionf(a){try{g();}catch(e){if(typeofe!=='number'&&e!==1)throwe;returna[0];}}%NeverOptimizeFunction(g);f();f();%OptimizeFunctionOnNextCall(f);dothrow=true;assertEquals(42,f([42]));