blob: 42b515a10b5afd58b03a93069f2d4075216570f2 [file] [log] [blame]
var assert = function (result, expected, message) {
if (result !== expected) {
throw new Error('Error in assert. Expected-' + expected + ' but was' + result + ':' + message );
}
};
var updated;
(function() {
eval(
'{\
function f() {\
return "first declaration";\
}\
}if (true) function f() { return "second declaration"; } else function _f() {}updated = f;'
);
}());
assert(typeof updated, 'function', "#1");
assert(updated(), 'second declaration', "#2");