Merge branch 'next' into strict-mode

This commit is contained in:
Isiah Meadows 2017-03-09 11:54:32 -05:00 committed by GitHub
commit 934e0ac55e
19 changed files with 316 additions and 537 deletions

View file

@ -24,9 +24,9 @@ o.spec("bundler", function() {
write("b.js", "module.exports = 1")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar b = 1\n}")
o(read("out.js")).equals(";(function() {\nvar b = 1\n}());")
remove("a.js")
remove("a.js")
remove("b.js")
remove("out.js")
})
@ -34,8 +34,8 @@ o.spec("bundler", function() {
write("a.js", 'var b = require("./b");')
write("b.js", "module.exports = 1;")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar b = 1;\n}")
o(read("out.js")).equals(";(function() {\nvar b = 1;\n}());")
remove("a.js")
remove("b.js")
@ -45,8 +45,8 @@ o.spec("bundler", function() {
write("a.js", 'let b = require("./b")')
write("b.js", "module.exports = 1")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nlet b = 1\n}")
o(read("out.js")).equals(";(function() {\nlet b = 1\n}());")
remove("a.js")
remove("b.js")
@ -56,8 +56,8 @@ o.spec("bundler", function() {
write("a.js", 'const b = require("./b")')
write("b.js", "module.exports = 1")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nconst b = 1\n}")
o(read("out.js")).equals(";(function() {\nconst b = 1\n}());")
remove("a.js")
remove("b.js")
@ -68,7 +68,7 @@ o.spec("bundler", function() {
write("b.js", "module.exports = 1")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar a = {}\na.b = 1\n}")
o(read("out.js")).equals(";(function() {\nvar a = {}\na.b = 1\n}());")
remove("a.js")
remove("b.js")
@ -79,7 +79,7 @@ o.spec("bundler", function() {
write("b.js", "module.exports = 1")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar b = {}\nb = 1\n}")
o(read("out.js")).equals(";(function() {\nvar b = {}\nb = 1\n}());")
remove("a.js")
remove("b.js")
@ -89,8 +89,8 @@ o.spec("bundler", function() {
write("a.js", '"use strict"\nvar b = require("./b")')
write("b.js", '"use strict"\nmodule.exports = 1')
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals('new function() {\n"use strict"\nvar b = 1\n}')
o(read("out.js")).equals(";(function() {\n"use strict"\nvar b = 1\n}());")
remove("a.js")
remove("b.js")
@ -101,7 +101,7 @@ o.spec("bundler", function() {
write("b.js", "'use strict'\nmodule.exports = 1")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\n'use strict'\nvar b = 1\n}")
o(read("out.js")).equals(";(function() {\n'use strict'\nvar b = 1\n}());")
remove("a.js")
remove("b.js")
@ -112,8 +112,8 @@ o.spec("bundler", function() {
write("b.js", "'use strict'\nmodule.exports = 1")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals('new function() {\n"use strict"\nvar b = 1\n}')
o(read("out.js")).equals(";(function() {\n"use strict"\nvar b = 1\n}());")
remove("a.js")
remove("b.js")
remove("out.js")
@ -123,7 +123,7 @@ o.spec("bundler", function() {
write("b.js", "module.exports = function() {return a}")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nwindow.a = 1\nvar b = function() {return a}\n}")
o(read("out.js")).equals(";(function() {\nwindow.a = 1\nvar b = function() {return a}\n}());")
remove("a.js")
remove("b.js")
@ -134,7 +134,7 @@ o.spec("bundler", function() {
write("b.js", "1 + 1")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\n1 + 1\n}")
o(read("out.js")).equals(";(function() {\n1 + 1\n}());")
remove("a.js")
remove("b.js")
@ -145,7 +145,7 @@ o.spec("bundler", function() {
write("b.js", "module.exports = []")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar _0 = []\nvar b = _0.toString()\n}")
o(read("out.js")).equals(";(function() {\nvar _0 = []\nvar b = _0.toString()\n}());")
remove("a.js")
remove("b.js")
@ -156,9 +156,9 @@ o.spec("bundler", function() {
write("b.js", "module.exports = []")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar _0 = []\nvar b = _0\n\t.toString()\n}")
o(read("out.js")).equals(";(function() {\nvar _0 = []\nvar b = _0\n\t.toString()\n}());")
remove("a.js")
remove("a.js")
remove("b.js")
remove("out.js")
})
@ -167,9 +167,9 @@ o.spec("bundler", function() {
write("b.js", "module.exports = function() {}")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar _0 = function() {}\nvar b = _0()\n}")
o(read("out.js")).equals(";(function() {\nvar _0 = function() {}\nvar b = _0()\n}());")
remove("a.js")
remove("a.js")
remove("b.js")
remove("out.js")
})
@ -178,7 +178,7 @@ o.spec("bundler", function() {
write("b.js", "module.exports = function() {}")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar _0 = function() {}\nvar b = _0\n()\n}")
o(read("out.js")).equals(";(function() {\nvar _0 = function() {}\nvar b = _0\n()\n}());")
remove("a.js")
remove("b.js")
@ -190,7 +190,7 @@ o.spec("bundler", function() {
write("c.js", 'var b = require("./b")\nmodule.exports = function() {return b}')
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar _0 = []\nvar b = _0.toString()\nvar b0 = _0\nvar c = function() {return b0}\n}")
o(read("out.js")).equals(";(function() {\nvar _0 = []\nvar b = _0.toString()\nvar b0 = _0\nvar c = function() {return b0}\n}());")
remove("a.js")
remove("b.js")
@ -203,7 +203,7 @@ o.spec("bundler", function() {
write("c.js", "var x\nmodule.exports = 2")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar b = 1\nvar x\nvar c = 2\n}")
o(read("out.js")).equals(";(function() {\nvar b = 1\nvar x\nvar c = 2\n}());")
remove("a.js")
remove("b.js")
@ -216,7 +216,7 @@ o.spec("bundler", function() {
write("c.js", "var cc = 2\nmodule.exports = cc")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar x = {}\nvar bb = 1\nx.b = bb\nvar cc = 2\nx.c = cc\n}")
o(read("out.js")).equals(";(function() {\nvar x = {}\nvar bb = 1\nx.b = bb\nvar cc = 2\nx.c = cc\n}());")
remove("a.js")
remove("b.js")
@ -229,7 +229,7 @@ o.spec("bundler", function() {
write("c.js", "var cc = 2\nmodule.exports = cc")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals('new function() {\nvar x = {}\nvar bb = 1\nx["b"] = bb\nvar cc = 2\nx["c"] = cc\n}')
o(read("out.js")).equals(";(function() {\nvar x = {}\nvar bb = 1\nx["b"] = bb\nvar cc = 2\nx["c"] = cc\n}());")
remove("a.js")
remove("b.js")
@ -241,7 +241,7 @@ o.spec("bundler", function() {
write("b.js", "var b = 1\nmodule.exports = 2")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar b0 = 1\nvar b = 2\n}")
o(read("out.js")).equals(";(function() {\nvar b0 = 1\nvar b = 2\n}());")
remove("a.js")
remove("b.js")
@ -253,7 +253,7 @@ o.spec("bundler", function() {
write("c.js", "var b = {}\nmodule.exports = b")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar b = {}\nb.x = 1\n}")
o(read("out.js")).equals(";(function() {\nvar b = {}\nb.x = 1\n}());")
remove("a.js")
remove("b.js")
@ -267,7 +267,7 @@ o.spec("bundler", function() {
write("d.js", "var a = 3\nmodule.exports = a")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar a = 1\nvar b = a\nvar a0 = 2\nvar c = a0\nvar a1 = 3\nvar d = a1\n}")
o(read("out.js")).equals(";(function() {\nvar a = 1\nvar b = a\nvar a0 = 2\nvar c = a0\nvar a1 = 3\nvar d = a1\n}());")
remove("a.js")
remove("b.js")
@ -281,7 +281,7 @@ o.spec("bundler", function() {
write("c.js", 'var a = require("./a").toString()\nvar b = require("./b")')
bundle(ns + "c.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar _0 = 123\nvar a = _0.toString()\nvar a0 = _0.toString()\nvar b = a0\n}")
o(read("out.js")).equals(";(function() {\nvar _0 = 123\nvar a = _0.toString()\nvar a0 = _0.toString()\nvar b = a0\n}());")
remove("a.js")
remove("b.js")
@ -293,7 +293,7 @@ o.spec("bundler", function() {
write("c.js", 'var b = require("./b")\nvar a = require("./a").toString()')
bundle(ns + "c.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar _0 = 123\nvar a0 = _0.toString()\nvar b = a0\nvar a = _0.toString()\n}")
o(read("out.js")).equals(";(function() {\nvar _0 = 123\nvar a0 = _0.toString()\nvar b = a0\nvar a = _0.toString()\n}());")
remove("a.js")
remove("b.js")
@ -306,7 +306,7 @@ o.spec("bundler", function() {
write("d.js", "module.exports = 1")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar d = 1\nvar b = function() {return d + 1}\nvar c = function() {return d + 2}\n}")
o(read("out.js")).equals(";(function() {\nvar d = 1\nvar b = function() {return d + 1}\nvar c = function() {return d + 2}\n}());")
remove("a.js")
remove("b.js")
@ -319,7 +319,7 @@ o.spec("bundler", function() {
write("b.js", "var b = 1\nmodule.exports = function() {return b}")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar b0 = 1\nvar b = function() {return b0}\n}")
o(read("out.js")).equals(";(function() {\nvar b0 = 1\nvar b = function() {return b0}\n}());")
remove("a.js")
remove("b.js")
@ -330,7 +330,7 @@ o.spec("bundler", function() {
write("b.js", "var a = 2\nmodule.exports = function() {return a}")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar a = 1\nvar a0 = 2\nvar b = function() {return a0}\n}")
o(read("out.js")).equals(";(function() {\nvar a = 1\nvar a0 = 2\nvar b = function() {return a0}\n}());")
remove("a.js")
remove("b.js")
@ -341,7 +341,7 @@ o.spec("bundler", function() {
write("b.js", "var a = 2\nmodule.exports = function() {return a}")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nfunction a() {}\nvar a0 = 2\nvar b = function() {return a0}\n}")
o(read("out.js")).equals(";(function() {\nfunction a() {}\nvar a0 = 2\nvar b = function() {return a0}\n}());")
remove("a.js")
remove("b.js")
@ -353,7 +353,7 @@ o.spec("bundler", function() {
write("c.js", "var a = 2\nmodule.exports = function() {return a}")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar a = 1\nvar b = function() {return a}\nvar a0 = 2\nvar c = function() {return a0}\n}")
o(read("out.js")).equals(";(function() {\nvar a = 1\nvar b = function() {return a}\nvar a0 = 2\nvar c = function() {return a0}\n}());")
remove("a.js")
remove("b.js")
@ -365,7 +365,7 @@ o.spec("bundler", function() {
write("b.js", 'var b = "b b b \\" b"\nmodule.exports = function() {return b}')
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals('new function() {\nvar b0 = "b b b \\" b"\nvar b = function() {return b0}\n}')
o(read("out.js")).equals(';(function() {\nvar b0 = "b b b \\\" b"\nvar b = function() {return b0}\n}());')
remove("a.js")
remove("b.js")
@ -376,7 +376,7 @@ o.spec("bundler", function() {
write("b.js", "var b = {b: 1}\nmodule.exports = function() {return b.b}")
bundle(ns + "a.js", ns + "out.js")
o(read("out.js")).equals("new function() {\nvar b0 = {b: 1}\nvar b = function() {return b0.b}\n}")
o(read("out.js")).equals(";(function() {\nvar b0 = {b: 1}\nvar b = function() {return b0.b}\n}());")
remove("a.js")
remove("b.js")