mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
* [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)
38 lines
1.0 KiB
JavaScript
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);
|