blob: eb0253069ace75e5e2ab6013a21781182e5af1c5 [file] [log] [blame]
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function write(v) { WScript.Echo(v + ""); }
function exceptToString(ee) {
if (ee instanceof TypeError) return "TypeError";
if (ee instanceof ReferenceError) return "ReferenceError";
if (ee instanceof EvalError) return "EvalError";
if (ee instanceof SyntaxError) return "SyntaxError";
return "Unknown Error";
}
(function Test1() {
var str = "with stmt";
try {
eval("with({}) {};");
} catch (e) {
write("Exception: " + str + " " + exceptToString(e));
return;
}
write("Return: " + str);
})();