test262-automation e9a5a7f918 [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time) (#1620)
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
2018-07-03 15:59:58 -04:00

38 lines
1.0 KiB
JavaScript

import { Cocoa, Cappuccino, Matcha } from "./scopes/drink.js"
import { shouldBe } from "./resources/assert.js";
var global = Function("return this")();
var globalEval = (0, eval);
global.Cappuccino = 'Global Scope';
{
let Cocoa = 42;
shouldBe(Cocoa, 42);
}
shouldBe(Cocoa, 'Cocoa');
shouldBe(Cappuccino, 'Cappuccino'); // Module Scope.
shouldBe(Matcha, 'Matcha');
(function () {
var Cocoa = 42;
let Cappuccino = 'Function Scope';
shouldBe(Cocoa, 42);
shouldBe(Cappuccino, 'Function Scope');
shouldBe(Matcha, 'Matcha');
{
let Cappuccino = 'Block Scope';
const Matcha = 50;
shouldBe(Matcha, 50);
shouldBe(Object, global.Object);
{
(function () {
shouldBe(Cappuccino, 'Block Scope');
shouldBe(globalEval(`Cappuccino`), 'Global Scope');
shouldBe(Function(`return Cappuccino`)(), 'Global Scope');
}());
}
}
shouldBe(Object, global.Object);
}());
shouldBe(Object, global.Object);