Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1127)

Unified Diff: test/mjsunit/harmony/sloppy-implicit-block-function.js

Issue 2478883002: Remove always-true --harmony-restrictive-declarations flag (Closed)
Patch Set: Formatting Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/harmony/sloppy-implicit-block-function.js
diff --git a/test/mjsunit/harmony/sloppy-implicit-block-function.js b/test/mjsunit/harmony/sloppy-implicit-block-function.js
deleted file mode 100644
index 07023208646201545269265d7c2b305b025d7c76..0000000000000000000000000000000000000000
--- a/test/mjsunit/harmony/sloppy-implicit-block-function.js
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --no-harmony-restrictive-declarations
-
-// ES#sec-functiondeclarations-in-ifstatement-statement-clauses
-// Annex B 3.4 FunctionDeclarations in IfStatement Statement Clauses
-// In sloppy mode, function declarations in if statements act like
-// they have a block around them. Prohibited in strict mode.
-(function() {
- assertEquals(undefined, f);
- if (false) function f() { };
- assertEquals(undefined, f);
-})();
-
-(function() {
- assertEquals(undefined, f);
- if (true) function f() { };
- assertEquals('function', typeof f);
-})();
-
-(function() {
- assertEquals(undefined, f);
- if (true) {} else function f() { };
- assertEquals(undefined, f);
-})();
-
-(function() {
- assertEquals(undefined, f);
- if (false) {} else function f() { };
- assertEquals('function', typeof f);
-})();
-
-// For legacy reasons, we also support these types of semantics as
-// the body of a for or with statement.
-(function() {
- for (;false;) function f() { };
- assertEquals(undefined, f);
-})();
-
-(function() {
- for (var x in {}) function f() { };
- assertEquals(undefined, f);
-})();
-
-(function() {
- var x;
- for (x in {}) function f() { };
- assertEquals(undefined, f);
-})();
-
-(function() {
- for (var i = 0; i < 1; i++) function f() { };
- assertEquals('function', typeof f);
-})();
-
-(function() {
- for (var x in {a: 1}) function f() { };
- assertEquals('function', typeof f);
-})();
-
-(function() {
- var x;
- for (x in {a: 1}) function f() { };
- assertEquals('function', typeof f);
-})();
-
-(function() {
- with ({}) function f() { };
- assertEquals('function', typeof f);
-})();
-
-(function() {
- do function f() {} while (0);
- assertEquals('function', typeof f);
-})();
-
-// Labeled function declarations undergo the same hoisting/FiB semantics as if
-// they were unalbeled.
-(function() {
- function bar() {
- return f;
- x: function f() {}
- }
- assertEquals('function', typeof bar());
-})();
-
-(function() {
- function bar() {
- return f;
- {
- x: function f() {}
- }
- }
- assertEquals(undefined, bar());
-})();
« no previous file with comments | « test/mjsunit/es6/sloppy-restrictive-block-function.js ('k') | test/mjsunit/harmony/sloppy-restrictive-block-function.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698