blob: e7702d86c99120d0d6d1d22ec8aa40ac23920203 [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.
//-------------------------------------------------------------------------------------------------------
WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
var tests = [
{
name: "Verify cached scope is invalidated",
body: function () {
function foo() {
var x = 100;
//create a stack allocated func
function bar() {
return x;
}
eval("count = bar;");
}
var count = {};
foo();
assert.areEqual(100, count(), "Function leaked from cached scope should cause cached scope to be invalidated");
}
},
];
testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });