Index: test/mjsunit/harmony/block-sloppy-function.js |
diff --git a/test/mjsunit/harmony/block-sloppy-function.js b/test/mjsunit/harmony/block-sloppy-function.js |
index a17a4c0799c7d9bced58941597f0b150f532ee7b..a28c71b63b5e8defb47f37a2d8f743c8f76f96af 100644 |
--- a/test/mjsunit/harmony/block-sloppy-function.js |
+++ b/test/mjsunit/harmony/block-sloppy-function.js |
@@ -146,12 +146,21 @@ |
assertEquals(2, f()); |
})(); |
-// Test that hoisting from blocks doesn't happen in global scope |
-function globalUnhoisted() { return 0; } |
+// Test that hoisting from blocks does happen in global scope |
adamk
2015/09/29 23:23:15
More tests, please:
- Negative cases: does not ho
|
+function globalHoisted() { return 0; } |
{ |
- function globalUnhoisted() { return 1; } |
+ function globalHoisted() { return 1; } |
} |
-assertEquals(0, globalUnhoisted()); |
+assertEquals(1, globalHoisted()); |
+ |
+// Test that hoisting from blocks does happen in an eval |
+eval(` |
+ function evalHoisted() { return 0; } |
+ { |
+ function evalHoisted() { return 1; } |
+ } |
+ assertEquals(1, evalHoisted()); |
+`); |
// Test that shadowing arguments is fine |
(function shadowArguments(x) { |