Backed out 4 changesets (bug 1524965) for flake8 failures. CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Wed, 06 Feb 2019 18:32:08 +0200
changeset 515379 2175133dd32360fd63bbc42805cd4e144c1fc0b8
parent 515378 4470bbd6ad9d3bc9b76dbea96c11762ff882b890
child 515380 c3cb1fec89a7e84b713f3cbeba6d9180a14f026c
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1524965
milestone67.0a1
backs out4470bbd6ad9d3bc9b76dbea96c11762ff882b890
45203e397c4a9342c90ab3f0d542119d122f3415
69c5e07b7aaed0f5b6230ab37ece564f4cd6f715
614dba865475b0d1266b12c8ba2ef6600c877508
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 4 changesets (bug 1524965) for flake8 failures. CLOSED TREE Backed out changeset 4470bbd6ad9d (bug 1524965) Backed out changeset 45203e397c4a (bug 1524965) Backed out changeset 69c5e07b7aae (bug 1524965) Backed out changeset 614dba865475 (bug 1524965)
js/src/frontend/BinASTParser.cpp
js/src/frontend/BinASTParserPerTokenizer.cpp
js/src/frontend/BinSource.yaml
js/src/jit-test/tests/binast/invalid/break-outside-while.binjs
js/src/jit-test/tests/binast/invalid/break-outside-while.dir
js/src/jit-test/tests/binast/invalid/continue-outside-while.binjs
js/src/jit-test/tests/binast/invalid/continue-outside-while.dir
js/src/jit-test/tests/binast/invalid/labelled-break-outside-while.binjs
js/src/jit-test/tests/binast/invalid/labelled-break-outside-while.dir
js/src/jit-test/tests/binast/invalid/labelled-continue-outside-while.binjs
js/src/jit-test/tests/binast/invalid/labelled-continue-outside-while.dir
js/src/jsapi-tests/binast/encode.py
js/src/jsapi-tests/binast/invalid/lib/filter_runner.py
js/src/jsapi-tests/binast/invalid/lib/filter_utils.py
js/src/jsapi-tests/binast/invalid/tests/break-outside-while.js
js/src/jsapi-tests/binast/invalid/tests/break-outside-while.py
js/src/jsapi-tests/binast/invalid/tests/continue-outside-while.js
js/src/jsapi-tests/binast/invalid/tests/continue-outside-while.py
js/src/jsapi-tests/binast/invalid/tests/labelled-break-outside-while.js
js/src/jsapi-tests/binast/invalid/tests/labelled-break-outside-while.py
js/src/jsapi-tests/binast/invalid/tests/labelled-continue-outside-while.js
js/src/jsapi-tests/binast/invalid/tests/labelled-continue-outside-while.py
js/src/tests/lib/jittests.py
--- a/js/src/frontend/BinASTParser.cpp
+++ b/js/src/frontend/BinASTParser.cpp
@@ -2032,31 +2032,28 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 #endif  // defined(DEBUG)
   RootedAtom label(cx_);
   MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
 
   if (label) {
     if (!IsIdentifier(label)) {
       return raiseError("Invalid identifier");
     }
-  }
-
-  auto validity = parseContext_->checkBreakStatement(
-      label ? label->asPropertyName() : nullptr);
-  if (validity.isErr()) {
-    switch (validity.unwrapErr()) {
-      case ParseContext::BreakStatementError::ToughBreak:
-        this->error(JSMSG_TOUGH_BREAK);
-        return cx_->alreadyReportedError();
-      case ParseContext::BreakStatementError::LabelNotFound:
-        this->error(JSMSG_LABEL_NOT_FOUND);
-        return cx_->alreadyReportedError();
+
+    auto validity = parseContext_->checkBreakStatement(label->asPropertyName());
+
+    if (validity.isErr()) {
+      switch (validity.unwrapErr()) {
+        case ParseContext::BreakStatementError::ToughBreak:
+          return raiseError(kind, "Not in a loop");
+        case ParseContext::BreakStatementError::LabelNotFound:
+          return raiseError(kind, "Label not found");
+      }
     }
   }
-
   BINJS_TRY_DECL(result, factory_.newBreakStatement(
                              label ? label->asPropertyName() : nullptr,
                              tokenizer_->pos(start)));
   return result;
 }
 
 template <typename Tok>
 JS::Result<ParseNode*> BinASTParser<Tok>::parseInterfaceCallExpression(
@@ -2320,28 +2317,26 @@ JS::Result<ParseNode*> BinASTParser<Tok>
 #endif  // defined(DEBUG)
   RootedAtom label(cx_);
   MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
 
   if (label) {
     if (!IsIdentifier(label)) {
       return raiseError("ContinueStatement - Label MUST be an identifier");
     }
-  }
-
-  auto validity = parseContext_->checkContinueStatement(
-      label ? label->asPropertyName() : nullptr);
-  if (validity.isErr()) {
-    switch (validity.unwrapErr()) {
-      case ParseContext::ContinueStatementError::NotInALoop:
-        this->error(JSMSG_BAD_CONTINUE);
-        return cx_->alreadyReportedError();
-      case ParseContext::ContinueStatementError::LabelNotFound:
-        this->error(JSMSG_LABEL_NOT_FOUND);
-        return cx_->alreadyReportedError();
+
+    auto validity = parseContext_->checkContinueStatement(
+        label ? label->asPropertyName() : nullptr);
+    if (validity.isErr()) {
+      switch (validity.unwrapErr()) {
+        case ParseContext::ContinueStatementError::NotInALoop:
+          return raiseError(kind, "Not in a loop");
+        case ParseContext::ContinueStatementError::LabelNotFound:
+          return raiseError(kind, "Label not found");
+      }
     }
   }
 
   BINJS_TRY_DECL(result, factory_.newContinueStatement(
                              label ? label->asPropertyName() : nullptr,
                              tokenizer_->pos(start)));
   return result;
 }
--- a/js/src/frontend/BinASTParserPerTokenizer.cpp
+++ b/js/src/frontend/BinASTParserPerTokenizer.cpp
@@ -767,17 +767,17 @@ BinASTParserPerTokenizer<Tok>::raiseOOM(
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseError(BinKind kind,
                                           const char* description) {
   Sprinter out(cx_);
   BINJS_TRY(out.init());
-  BINJS_TRY(out.printf("In %s, %s", describeBinKind(kind), description));
+  BINJS_TRY(out.printf("In %s, ", description));
   return tokenizer_->raiseError(out.string());
 }
 
 template <typename Tok>
 mozilla::GenericErrorResult<JS::Error&>
 BinASTParserPerTokenizer<Tok>::raiseError(const char* description) {
   return tokenizer_->raiseError(description);
 }
--- a/js/src/frontend/BinSource.yaml
+++ b/js/src/frontend/BinSource.yaml
@@ -632,32 +632,29 @@ BreakStatement:
           RootedAtom label(cx_);
           MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
 
   build: |
     if (label) {
       if (!IsIdentifier(label)) {
         return raiseError("Invalid identifier");
       }
-    }
+
+      auto validity
+          = parseContext_->checkBreakStatement(label->asPropertyName());
 
-    auto validity
-        = parseContext_->checkBreakStatement(label ? label->asPropertyName()
-                                                    : nullptr);
-    if (validity.isErr()) {
-      switch (validity.unwrapErr()) {
-        case ParseContext::BreakStatementError::ToughBreak:
-          this->error(JSMSG_TOUGH_BREAK);
-          return cx_->alreadyReportedError();
-        case ParseContext::BreakStatementError::LabelNotFound:
-          this->error(JSMSG_LABEL_NOT_FOUND);
-          return cx_->alreadyReportedError();
+      if (validity.isErr()) {
+        switch (validity.unwrapErr()) {
+          case ParseContext::BreakStatementError::ToughBreak:
+            return raiseError(kind, "Not in a loop");
+          case ParseContext::BreakStatementError::LabelNotFound:
+            return raiseError(kind, "Label not found");
+        }
       }
     }
-
     BINJS_TRY_DECL(result,
                    factory_.newBreakStatement(label ? label->asPropertyName()
                                                     : nullptr,
                                               tokenizer_->pos(start)));
 
 CallExpression:
   build: |
     auto op = JSOP_CALL;
@@ -773,35 +770,32 @@ ContinueStatement:
           RootedAtom label(cx_);
           MOZ_TRY_VAR(label, tokenizer_->readMaybeAtom());
 
   build: |
     if (label) {
       if (!IsIdentifier(label)) {
         return raiseError("ContinueStatement - Label MUST be an identifier");
       }
-    }
 
-    auto validity
-        = parseContext_->checkContinueStatement(label ? label->asPropertyName()
-                                                      : nullptr);
-    if (validity.isErr()) {
-      switch (validity.unwrapErr()) {
-        case ParseContext::ContinueStatementError::NotInALoop:
-          this->error(JSMSG_BAD_CONTINUE);
-          return cx_->alreadyReportedError();
-        case ParseContext::ContinueStatementError::LabelNotFound:
-          this->error(JSMSG_LABEL_NOT_FOUND);
-          return cx_->alreadyReportedError();
+      auto validity
+          = parseContext_->checkContinueStatement(label ? label->asPropertyName()
+                                                        : nullptr);
+      if (validity.isErr()) {
+        switch (validity.unwrapErr()) {
+          case ParseContext::ContinueStatementError::NotInALoop:
+            return raiseError(kind, "Not in a loop");
+          case ParseContext::ContinueStatementError::LabelNotFound:
+            return raiseError(kind, "Label not found");
+        }
       }
     }
 
     BINJS_TRY_DECL(result,
-                   factory_.newContinueStatement(label ? label->asPropertyName()
-                                                       : nullptr,
+                   factory_.newContinueStatement(label ? label->asPropertyName() : nullptr,
                                                  tokenizer_->pos(start)));
 
 DataProperty:
   build: |
     if (!factory_.isUsableAsObjectPropertyName(name)) {
       return raiseError("DataProperty key kind");
     }
 
deleted file mode 100644
index 4e2739246311dad7a2bf5a8954ba2f8d605e84fd..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/js/src/jit-test/tests/binast/invalid/break-outside-while.dir
+++ /dev/null
@@ -1,1 +0,0 @@
-// |jit-test| error: unlabeled break must be inside loop or switch
\ No newline at end of file
deleted file mode 100644
index 093c05a6684b5beb2ef82cb901ca40d8ff8fc44b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/js/src/jit-test/tests/binast/invalid/continue-outside-while.dir
+++ /dev/null
@@ -1,1 +0,0 @@
-// |jit-test| error: continue must be inside loop
\ No newline at end of file
deleted file mode 100644
index 50fc299705103650740558515ac9de0fb94c5120..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/js/src/jit-test/tests/binast/invalid/labelled-break-outside-while.dir
+++ /dev/null
@@ -1,1 +0,0 @@
-// |jit-test| error: label not found
\ No newline at end of file
deleted file mode 100644
index 0fb72bf49040b312d1bf2835dc96527df5595df2..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/js/src/jit-test/tests/binast/invalid/labelled-continue-outside-while.dir
+++ /dev/null
@@ -1,1 +0,0 @@
-// |jit-test| error: continue must be inside loop
\ No newline at end of file
--- a/js/src/jsapi-tests/binast/encode.py
+++ b/js/src/jsapi-tests/binast/encode.py
@@ -12,19 +12,16 @@ from sets import Set
 
 parser = OptionParser()
 parser.add_option('--topsrcdir', dest='topsrcdir',
                   help='path to mozilla-central')
 parser.add_option('--binjsdir', dest='binjsdir',
                   help='cwd when running binjs_encode')
 parser.add_option('--binjs_encode', dest='binjs_encode',
                   help='path to binjs_encode commad')
-parser.add_option('--binjs_convert_from_json', dest='binjs_convert_from_json',
-                  default="",
-                  help='path to binjs_convert_from_json commad (optional)')
 (options, filters) = parser.parse_args()
 
 
 def ensure_dir(path, name):
     """ Ensure the given directory exists.
     If the directory doesn't exist, exits with non-zero status.
 
     :param path (string)
@@ -51,40 +48,20 @@ def ensure_file(path, name):
         print('{} {} does not exit'.format(name, path),
               file=sys.stderr)
         sys.exit(1)
 
 
 ensure_dir(options.topsrcdir, 'topsrcdir')
 ensure_dir(options.binjsdir, 'binjsdir')
 ensure_file(options.binjs_encode, 'binjs_encode command')
-if options.binjs_convert_from_json:
-    ensure_file(options.binjs_convert_from_json, 'binjs_convert_from_json command')
 
 jittest_dir = os.path.join(options.topsrcdir, 'js', 'src', 'jit-test', 'tests')
 ensure_dir(jittest_dir, 'jit-test')
 
-jsapi_tests_dir = os.path.join(options.topsrcdir, 'js', 'src', 'jsapi-tests')
-ensure_dir(jsapi_tests_dir, 'binast in jsapi-tests')
-
-jsapi_binast_dir = os.path.join(jsapi_tests_dir, 'binast')
-ensure_dir(jsapi_binast_dir, 'binast in jsapi-tests')
-
-invalid_tests_dir = os.path.join(jsapi_binast_dir, 'invalid', 'tests')
-ensure_dir(invalid_tests_dir, 'invalid tests')
-
-invalid_lib_dir = os.path.join(jsapi_binast_dir, 'invalid', 'lib')
-ensure_dir(invalid_lib_dir, 'library for libvalid tests')
-sys.path.insert(0, os.path.join(invalid_lib_dir))
-
-invalid_tests_output_dir = os.path.join(jittest_dir, 'binast', 'invalid')
-ensure_dir(invalid_tests_output_dir, 'invalid tests output')
-
-import filter_runner
-
 
 def check_filter(outfile_path):
     """ Check if the output file is the target.
 
     :return (bool)
             True if the file is target and should be written.
     """
     if len(filters) == 0:
@@ -363,65 +340,19 @@ def convert_wpt():
            os.path.join(wpt_binast_dir, 'large.binjs'))
     encode(os.path.join(wpt_binast_dir, 'small-binjs.js'),
            os.path.join(wpt_binast_dir, 'small.binjs'))
 
 
 def convert_jsapi_test():
     """ Convert jsapi-test files into .binjs.
     """
-    encode_inplace(os.path.join(jsapi_binast_dir, 'parser', 'multipart'))
-
-
-def convert(infile_path, filter_path, outfile_path, binjs_convert_from_json_args=[]):
-    """ Convert the given .js file into .binjs, with filter applied.
-
-    :param infile_path (string)
-           The path to the input .js file.
-    :param filter_path (string)
-           The path to the filter .py file.
-    :param outfile_path (string)
-           The path to the output .binjs file.
-
-    :param binjs_convert_from_json_args (list)
-           The command line arguments passed to binjs_convert_from_json command.
-    """
-
-    if not check_filter(outfile_path):
-        return
-
-    print(' converting', infile_path)
-    print('         to', outfile_path)
-    print('with filter', filter_path)
+    binast_test_dir = os.path.join(options.topsrcdir, 'js', 'src', 'jsapi-tests', 'binast')
+    ensure_dir(binast_test_dir, 'binast in jsapi-tests')
 
-    infile = open(infile_path)
-    outfile = open(outfile_path, 'w')
-
-    source = subprocess.check_output(
-        [options.binjs_encode, 'advanced', 'json'],
-        cwd=options.binjsdir, stdin=infile)
-
-    filtered_source = filter_runner.run(filter_path, source)
+    encode_inplace(os.path.join(binast_test_dir, 'parser', 'multipart'))
 
-    convert_from_json = subprocess.Popen(
-        [options.binjs_convert_from_json] + binjs_convert_from_json_args,
-        cwd=options.binjsdir, stdin=subprocess.PIPE, stdout=outfile)
-    convert_from_json.stdin.write(filtered_source)
-    convert_from_json.stdin.close()
-
-def convert_invalid_test():
-    for root, dirs, files in os.walk(invalid_tests_dir):
-        for filename in files:
-            if filename.endswith('.js'):
-                infile_path = os.path.join(root, filename)
-                filter_path = os.path.join(root, filename.replace('.js', '.py'))
-                outfile_path = os.path.join(invalid_tests_output_dir,
-                                            filename.replace('.js', '.binjs'))
-                convert(infile_path, filter_path, outfile_path)
 
 convert_jittest()
 
 convert_wpt()
 
 convert_jsapi_test()
-
-if options.binjs_convert_from_json:
-    convert_invalid_test()
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/lib/filter_runner.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# A utility to run filter program for given JSON format BinAST.
-
-import json
-import runpy
-
-def run(filter_path, source):
-    """
-    Run filter script against JSON source.
-
-    :param filter_path(string)
-           The path to the filter script (python script)
-    :param source(string)
-           The string representation of JSON format of BinAST file
-    :returns (string)
-             The string representation of filtered JSON
-    """
-    ast = json.loads(source)
-
-    # The filter script is executed with sys.path that has this directory in
-    # the first element, so that it can import filter_utils.
-    filter_global = runpy.run_path(filter_path)
-
-    filtered_ast = filter_global['filter_ast'](ast)
-
-    return json.dumps(filtered_ast)
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/lib/filter_utils.py
+++ /dev/null
@@ -1,170 +0,0 @@
-# Utilities to modify JSON encoded AST
-#
-# All functions raise exception on unexpected case, to avoid overlooking AST
-# change.
-
-def assert_tagged_tuple(obj):
-    """
-    Assert that the object is a tagged tuple
-
-    :param obj (dict)
-           The tagged tuple
-    """
-    type_ = obj['@TYPE']
-    if type_ != 'tagged tuple':
-        raise Exception('expected a tagged tuple, got {}'.format(type_))
-
-def assert_list(obj):
-    """
-    Assert that the object is a list
-
-    :param obj (dict)
-           The list
-    """
-    type_ = obj['@TYPE']
-    if type_ != 'list':
-        raise Exception('expected a list, got {}'.format(type_))
-
-def assert_interface(obj, expected_name):
-    """
-    Assert that the object is a tagged tuple for given interface
-
-    :param obj (dict)
-           The tagged tuple
-    :param expected_name (string)
-           The name of the interface
-    """
-    assert_tagged_tuple(obj)
-    actual_name = obj['@INTERFACE']
-    if actual_name != expected_name:
-        raise Exception('expected {}, got {}'.format(expected_name, actual_name))
-
-def get_field(obj, name):
-    """
-    Returns the field of the tagged tuple.
-
-    :param obj (dict)
-           The tagged tuple
-    :param name (string)
-           The name of the field to get
-    :return (dict)
-            The field value
-    :raises Exception
-            If there's no such field
-    """
-    assert_tagged_tuple(obj)
-    fields = obj['@FIELDS']
-    for field in fields:
-        if field['@FIELD_NAME'] == name:
-            return field['@FIELD_VALUE']
-    raise Exception('No such field: {}'.format(name))
-
-def replace_field(obj, name, value):
-    """
-    Replaces the field of the tagged tuple.
-
-    :param obj (dict)
-           the tagged tuple
-    :param name (string)
-           the name of the field to replace
-    :param value (dict)
-           the value of the field
-    :raises Exception
-            If there's no such field
-    """
-    assert_tagged_tuple(obj)
-    fields = obj['@FIELDS']
-    for field in fields:
-        if field['@FIELD_NAME'] == name:
-            field['@FIELD_VALUE'] = value
-            return
-    raise Exception('No such field: {}'.format(name))
-
-def remove_field(obj, name):
-    """
-    Removes the field from the tagged tuple
-
-    :param obj (dict)
-           the tagged tuple
-    :param name (string)
-           the name of the field to remove
-    :raises Exception
-            If there's no such field
-    """
-    assert_tagged_tuple(obj)
-    i = 0
-    fields = obj['@FIELDS']
-    for field in fields:
-        if field['@FIELD_NAME'] == name:
-            del fields[i]
-            return
-        i += 1
-    raise Exception('No such field: {}'.format(name))
-
-def get_element(obj, i):
-    """
-    Returns the element of the list.
-
-    :param obj (dict)
-           The list
-    :param i (int)
-           The indef of the element to get
-    :return (dict)
-            The element value
-    :raises Exception
-            On out of bound access
-    """
-    assert_list(obj)
-    elements = obj['@VALUE']
-    if i >= len(elements):
-        raise Exception('Out of bound: {} < {}'.format(i, len(elements)))
-    return elements[i]
-
-def replace_element(obj, i, value):
-    """
-    Replaces the element of the list.
-
-    :param obj (dict)
-           the list
-    :param i (int)
-           The indef of the element to replace
-    :param value (dict)
-           the value of the element
-    :raises Exception
-            On out of bound access
-    """
-    assert_list(obj)
-    elements = obj['@VALUE']
-    if i >= len(elements):
-        raise Exception('Out of bound: {} < {}'.format(i, len(elements)))
-    elements[i] = value
-
-def append_element(obj, value):
-    """
-    Appends the element to the list.
-
-    :param obj (dict)
-           the list
-    :param value (dict)
-           the value to be added to the list
-    """
-    assert_list(obj)
-    elements = obj['@VALUE']
-    elements.append(value)
-
-def remove_element(obj, i):
-    """
-    Removes the element from the list
-
-    :param obj (dict)
-           the list
-    :param i (int)
-           The indef of the element to remove
-    :raises Exception
-            On out of bound access
-    """
-    assert_list(obj)
-    elements = obj['@VALUE']
-    if i >= len(elements):
-        raise Exception('Out of bound: {} < {}'.format(i, len(elements)))
-    del elements[i]
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/tests/break-outside-while.js
+++ /dev/null
@@ -1,3 +0,0 @@
-while (true) {
-  break;
-}
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/tests/break-outside-while.py
+++ /dev/null
@@ -1,21 +0,0 @@
-def filter_ast(ast):
-    # Move a break statement out of a while loop.
-    import filter_utils as utils
-
-    utils.assert_interface(ast, 'Script')
-    global_stmts = utils.get_field(ast, 'statements')
-
-    while_stmt = utils.get_element(global_stmts, 0)
-    utils.assert_interface(while_stmt, 'WhileStatement')
-
-    while_body = utils.get_field(while_stmt, 'body')
-    utils.assert_interface(while_body, 'Block')
-    while_body_stmts = utils.get_field(while_body, 'statements')
-
-    break_stmt = utils.get_element(while_body_stmts, 0)
-    utils.assert_interface(break_stmt, 'BreakStatement')
-
-    utils.remove_element(while_body_stmts, 0)
-    utils.append_element(global_stmts, break_stmt)
-
-    return ast
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/tests/continue-outside-while.js
+++ /dev/null
@@ -1,3 +0,0 @@
-while (true) {
-  continue;
-}
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/tests/continue-outside-while.py
+++ /dev/null
@@ -1,21 +0,0 @@
-def filter_ast(ast):
-    # Move a continue statement out of a while loop.
-    import filter_utils as utils
-
-    utils.assert_interface(ast, 'Script')
-    global_stmts = utils.get_field(ast, 'statements')
-
-    while_stmt = utils.get_element(global_stmts, 0)
-    utils.assert_interface(while_stmt, 'WhileStatement')
-
-    while_body = utils.get_field(while_stmt, 'body')
-    utils.assert_interface(while_body, 'Block')
-    while_body_stmts = utils.get_field(while_body, 'statements')
-
-    continue_stmt = utils.get_element(while_body_stmts, 0)
-    utils.assert_interface(continue_stmt, 'ContinueStatement')
-
-    utils.remove_element(while_body_stmts, 0)
-    utils.append_element(global_stmts, continue_stmt)
-
-    return ast
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/tests/labelled-break-outside-while.js
+++ /dev/null
@@ -1,3 +0,0 @@
-foo: while (true) {
-  break foo;
-}
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/tests/labelled-break-outside-while.py
+++ /dev/null
@@ -1,24 +0,0 @@
-def filter_ast(ast):
-    # Move a break statement out of a while loop.
-    import filter_utils as utils
-
-    utils.assert_interface(ast, 'Script')
-    global_stmts = utils.get_field(ast, 'statements')
-
-    labelled_stmt = utils.get_element(global_stmts, 0)
-    utils.assert_interface(labelled_stmt, 'LabelledStatement')
-
-    while_stmt = utils.get_field(labelled_stmt, 'body')
-    utils.assert_interface(while_stmt, 'WhileStatement')
-
-    while_body = utils.get_field(while_stmt, 'body')
-    utils.assert_interface(while_body, 'Block')
-    while_body_stmts = utils.get_field(while_body, 'statements')
-
-    break_stmt = utils.get_element(while_body_stmts, 0)
-    utils.assert_interface(break_stmt, 'BreakStatement')
-
-    utils.remove_element(while_body_stmts, 0)
-    utils.append_element(global_stmts, break_stmt)
-
-    return ast
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/tests/labelled-continue-outside-while.js
+++ /dev/null
@@ -1,3 +0,0 @@
-foo: while (true) {
-  continue foo;
-}
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/invalid/tests/labelled-continue-outside-while.py
+++ /dev/null
@@ -1,24 +0,0 @@
-def filter_ast(ast):
-    # Move a continue statement out of a while loop.
-    import filter_utils as utils
-
-    utils.assert_interface(ast, 'Script')
-    global_stmts = utils.get_field(ast, 'statements')
-
-    labelled_stmt = utils.get_element(global_stmts, 0)
-    utils.assert_interface(labelled_stmt, 'LabelledStatement')
-
-    while_stmt = utils.get_field(labelled_stmt, 'body')
-    utils.assert_interface(while_stmt, 'WhileStatement')
-
-    while_body = utils.get_field(while_stmt, 'body')
-    utils.assert_interface(while_body, 'Block')
-    while_body_stmts = utils.get_field(while_body, 'statements')
-
-    continue_stmt = utils.get_element(while_body_stmts, 0)
-    utils.assert_interface(continue_stmt, 'ContinueStatement')
-
-    utils.remove_element(while_body_stmts, 0)
-    utils.append_element(global_stmts, continue_stmt)
-
-    return ast
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -388,18 +388,16 @@ def find_tests(substring=None, run_binas
         if dirpath == '.':
             continue
 
         if not run_binast:
             if os.path.join('binast', 'lazy') in dirpath:
                 continue
             if os.path.join('binast', 'nonlazy') in dirpath:
                 continue
-            if os.path.join('binast', 'invalid') in dirpath:
-                continue
 
         for filename in filenames:
             if not (filename.endswith('.js') or filename.endswith('.binjs')):
                 continue
             if filename in ('shell.js', 'browser.js'):
                 continue
             test = os.path.join(dirpath, filename)
             if substring is None \