Libraries: Move to Userland/Libraries/

This commit is contained in:
Andreas Kling 2021-01-12 12:17:30 +01:00
parent dc28c07fa5
commit 13d7c09125
Notes: sideshowbarker 2024-07-18 23:53:55 +09:00
1857 changed files with 266 additions and 274 deletions

View file

@ -1,39 +0,0 @@
test("basic functionality", () => {
let callHoisted = hoisted();
function hoisted() {
return "foo";
}
expect(hoisted()).toBe("foo");
expect(callHoisted).toBe("foo");
});
// First two calls produce a ReferenceError, but the declarations should be hoisted
test.skip("functions are hoisted across non-lexical scopes", () => {
expect(scopedHoisted).toBeUndefined();
expect(callScopedHoisted).toBeUndefined();
{
var callScopedHoisted = scopedHoisted();
function scopedHoisted() {
return "foo";
}
expect(scopedHoisted()).toBe("foo");
expect(callScopedHoisted).toBe("foo");
}
expect(scopedHoisted()).toBe("foo");
expect(callScopedHoisted).toBe("foo");
});
test("functions are not hoisted across lexical scopes", () => {
const test = () => {
var iife = (function () {
return declaredLater();
})();
function declaredLater() {
return "yay";
}
return iife;
};
expect(() => declaredLater).toThrow(ReferenceError);
expect(test()).toBe("yay");
});