nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: TheBrainFamily/cypress-cucumber-preprocessor
Pull request #176 (2019-06-06 09:56:40)

Bug/inherit feature tags
Solves tag inheritance issue raised by @RMoroney in #156 


Patch:
diff --git a/cypress-tags.js b/cypress-tags.js
index b89e28f..a36daf5 100755
--- a/cypress-tags.js
+++ b/cypress-tags.js
@@ -47,7 +47,9 @@ paths.forEach(featurePath => {
 
 try {
   execFileSync(
-    `${__dirname}/../.bin/cypress`,
+    process.platform === "win32"
+      ? `${__dirname}/../.bin/cypress.cmd`
+      : `${__dirname}/../.bin/cypress`,
     [...process.argv.slice(2), "--spec", featuresToRun.join(",")],
     {
       stdio: [process.stdin, process.stdout, process.stderr]
diff --git a/cypress/integration/TagsInheritance.feature b/cypress/integration/TagsInheritance.feature
new file mode 100644
index 0000000..43a88ea
--- /dev/null
+++ b/cypress/integration/TagsInheritance.feature
@@ -0,0 +1,9 @@
+@inherited-tag
+Feature: Tags Implementation
+
+  As a cucumber user I can use tag expression using both feature and scenario tags
+
+  @own-tag
+  Scenario: This scenario should run if @inherited-tag and @own-tag is present in env
+    Given '@inherited-tag and @own-tag' is in current TAGS environmental variable
+    Then this should run


Test patch:
diff --git a/lib/createTestsFromFeature.js b/lib/createTestsFromFeature.js
index 9934773..914b3a0 100644
--- a/lib/createTestsFromFeature.js
+++ b/lib/createTestsFromFeature.js
@@ -20,7 +20,7 @@ const createTestsFromFeature = parsedFeature => {
       section =>
         section.tags &&
         section.tags.length &&
-        shouldProceedCurrentStep(section.tags)
+        shouldProceedCurrentStep(section.tags.concat(featureTags))
     );
   } else if (!sectionsWithTagsExist) {
     everythingShouldRun = true;
diff --git a/lib/resolveStepDefinition.test.js b/lib/resolveStepDefinition.test.js
index 777dc0d..d534fee 100644
--- a/lib/resolveStepDefinition.test.js
+++ b/lib/resolveStepDefinition.test.js
@@ -97,6 +97,17 @@ describe("Tags implementation", () => {
   );
 });
 
+describe("Tags inheritance", () => {
+  window.Cypress = {
+    env: () => "@inherited-tag and @own-tag"
+  };
+  require("../cypress/support/step_definitions/tags_implementation_with_env_set");
+
+  createTestsFromFeature(
+    readAndParseFeatureFile("./cypress/integration/TagsInheritance.feature")
+  );
+});
+
 describe("Tags with env TAGS set", () => {
   window.Cypress = {
     env: () => "@test-tag and not @ignore-tag"
Repository: BRIKEV/express-jsdoc-swagger
Pull request #56 (2020-06-12 15:45:47)

fix: only comment regex
### What kind of change does this PR introduce? (check at least one)
 - [X] Bugfix
 - [ ] Feature
 - [ ] Test
 - [ ] Docs
 - [ ] Refactor
 - [ ] Build-related changes
 - [ ] Other, please describe:

### Description:

This PR fixes a problem when there is code before the comment and the comment has spaces or tabs.



bri06: Cool 👍

Patch:
diff --git a/consumers/utils/getComments.js b/consumers/utils/getComments.js
index 4b4b095..b525fb4 100644
--- a/consumers/utils/getComments.js
+++ b/consumers/utils/getComments.js
@@ -1,5 +1,5 @@
 
-const COMMENTS_PATTERN = /(^(\/\*+[\s\S]*?\*\/)|(\/\*+.*\*\/)|^\/\/.*?[\r\n])[\r\n]*/gm;
+const COMMENTS_PATTERN = /((\/\*+[\s\S]*?\*\/)|(\/\*+.*\*\/)|^\/\/.*?[\r\n])[\r\n]*/gm;
 const BREAK_LINE = /\n/g;
 
 const getComments = text => {


Test patch:
diff --git a/test/consumers/getOnlyComments/index.test.js b/test/consumers/getOnlyComments/index.test.js
index 67b4593..b833ec9 100644
--- a/test/consumers/getOnlyComments/index.test.js
+++ b/test/consumers/getOnlyComments/index.test.js
@@ -100,4 +100,24 @@ describe('get only comments consumer method', () => {
     expect(result).toHaveLength(3);
     expect(result).toEqual(expected);
   });
+
+  it('should return JSdoc comment that is not at the begining of the line', () => {
+    const input = [`
+      File with comments with tabulation
+    
+      /**
+       * @param  {[type]}
+       * @param  {[type]}
+       * @return {[type]}
+       */
+    `];
+    const expected = [`/**
+       * @param  {[type]}
+       * @param  {[type]}
+       * @return {[type]}
+       */`];
+    const result = getOnlyComments(input);
+    expect(result).toHaveLength(1);
+    expect(result).toEqual(expected);
+  });
 });
Repository: BRIKEV/express-jsdoc-swagger
Pull request #58 (2020-06-12 16:24:51)

feat: improve utils coverage
### What kind of change does this PR introduce? (check at least one)
 - [ ] Bugfix
 - [ ] Feature
 - [X] Test
 - [ ] Docs
 - [ ] Refactor
 - [ ] Build-related changes
 - [ ] Other, please describe:

### Description:

This PR adds some tests and improve coverage in utils folder.



Patch:
diff --git a/consumers/globFilesMatches.js b/consumers/globFilesMatches.js
index 3cdd71a..93419b3 100644
--- a/consumers/globFilesMatches.js
+++ b/consumers/globFilesMatches.js
@@ -5,7 +5,7 @@ const DEFAULT_EXCLUDED_FOLDER = 'node_modules';
 
 const globFilesMatches = (baseDir, filePath, excludedFolder = DEFAULT_EXCLUDED_FOLDER) => (
   new Promise((resolve, reject) => {
-    if (!baseDir && !filePath) {
+    if (!baseDir || !filePath) {
       const error = new Error('baseDir and filePath are required');
       return reject(error);
     }


Test patch:
diff --git a/test/consumers/globFilesMatches/index.test.js b/test/consumers/globFilesMatches/index.test.js
index 3271b62..74a7f2c 100644
--- a/test/consumers/globFilesMatches/index.test.js
+++ b/test/consumers/globFilesMatches/index.test.js
@@ -9,6 +9,26 @@ describe('glob Files matches method', () => {
       });
   });
 
+  it('should return error when baseDir is undefined', done => {
+    const baseDir = undefined;
+    const filePath = './**/**.txt';
+    globFilesMatches(baseDir, filePath)
+      .catch(error => {
+        expect(error.message).toEqual('baseDir and filePath are required');
+        done();
+      });
+  });
+
+  it('should return error when glob method not receives a string type', done => {
+    const baseDir = 2; // This forces error in glob method
+    const filePath = './**/**.txt';
+    globFilesMatches(baseDir, filePath)
+      .catch(error => {
+        expect(error.message).toMatch(/The "path" argument must be of type string. Received type number/);
+        done();
+      });
+  });
+
   it('should return example.txt and excluded/example.txt file', done => {
     const baseDir = __dirname;
     const filePath = './**/**.txt';
diff --git a/test/consumers/readFiles/index.test.js b/test/consumers/readFiles/index.test.js
index d887cdf..e5fca9d 100644
--- a/test/consumers/readFiles/index.test.js
+++ b/test/consumers/readFiles/index.test.js
@@ -12,6 +12,17 @@ describe('readFiles', () => {
       .catch(done);
   });
 
+  it('should throw an error when file is not found', done => {
+    const input = [
+      `${__dirname}/fixtures/not-found.txt`,
+    ];
+    readFiles(input)
+      .catch(error => {
+        expect(error.message).toMatch(/ENOENT: no such file or directory, open/);
+        done();
+      });
+  });
+
   it('should return empty array when we do not send array as param', done => {
     const input = [
       `${__dirname}/fixtures/example.txt`,
Repository: BRIKEV/express-jsdoc-swagger
Pull request #153 (2021-04-30 11:41:27)

feat: add support for `@returns` tag
### What kind of change does this PR introduce? (check at least one)
 - [ ] Bugfix
 - [x] Feature
 - [x] Test
 - [ ] Docs
 - [ ] Refactor
 - [ ] Build-related changes
 - [ ] Other, please describe:

### Description:
JSDocs provides a [`@returns` tag](https://jsdoc.app/tags-returns.html) with the same meaning as `@return`. This PR adds support to this tag, so both `@return` and `@returns` can be used to document the output of an endpoint. 


Patch:
diff --git a/transforms/paths/index.js b/transforms/paths/index.js
index 8556f53..20ab60f 100644
--- a/transforms/paths/index.js
+++ b/transforms/paths/index.js
@@ -38,7 +38,10 @@ const pathValues = tags => {
   const deprecated = getTagInfo(tags, 'deprecated');
   const isDeprecated = !!deprecated;
   /* Response info */
-  const returnValues = getTagsInfo(tags, 'return');
+  const returnValues = [
+    ...getTagsInfo(tags, 'return'),
+    ...getTagsInfo(tags, 'returns'),
+  ];
   const responseExamples = examples.filter(example => example.type === 'response');
   const responses = responsesGenerator(returnValues, responseExamples);
   /* Parameters info */


Test patch:
diff --git a/test/transforms/paths/responses.test.js b/test/transforms/paths/responses.test.js
index 922cc4a..84d641e 100644
--- a/test/transforms/paths/responses.test.js
+++ b/test/transforms/paths/responses.test.js
@@ -53,6 +53,56 @@ describe('response tests', () => {
       .toEqual(expected);
   });
 
+  it('should parse jsdoc with responses, whether @return or @returns tags are used', () => {
+    const jsdocInput = [`
+      /**
+       * GET /api/v1
+       * @summary This is the summary of the endpoint
+       * @return {object} 200 - success response - application/json
+       * @returns {object} 400 - Bad request response
+       */
+    `];
+    const expected = {
+      paths: {
+        '/api/v1': {
+          get: {
+            deprecated: false,
+            summary: 'This is the summary of the endpoint',
+            parameters: [],
+            tags: [],
+            security: [],
+            responses: {
+              200: {
+                description: 'success response',
+                content: {
+                  'application/json': {
+                    schema: {
+                      type: 'object',
+                    },
+                  },
+                },
+              },
+              400: {
+                description: 'Bad request response',
+                content: {
+                  'application/json': {
+                    schema: {
+                      type: 'object',
+                    },
+                  },
+                },
+              },
+            },
+          },
+        },
+      },
+    };
+    const parsedJSDocs = jsdocInfo()(jsdocInput);
+    const result = setPaths({}, parsedJSDocs);
+    expect(result)
+      .toEqual(expected);
+  });
+
   it('should not parse jsdoc with wrong info and return warning in the console', () => {
     global.console = {
       ...global.console,
Repository: DmitrySoshnikov/regexp-tree
Pull request #200 (2019-12-03 09:12:16)

Enable blacklisting of optimizations
Makes it easier to disable some optimizations, as requested in eg. #199. Also adds some specific tests for one of the feature that's highlighted in #199 and is a partial fix for that issue.


Patch:
diff --git a/src/optimizer/index.js b/src/optimizer/index.js
index ea076de..4f9449f 100644
--- a/src/optimizer/index.js
+++ b/src/optimizer/index.js
@@ -27,11 +27,13 @@ module.exports = {
    *
    *   /\w+e+/
    */
-  optimize(regexp, transformsWhitelist = []) {
-    const transformToApply =
-      transformsWhitelist.length > 0
-        ? transformsWhitelist
-        : Object.keys(optimizationTransforms);
+  optimize(regexp, {whitelist = [], blacklist = []} = {}) {
+    const transformsRaw =
+      whitelist.length > 0 ? whitelist : Object.keys(optimizationTransforms);
+
+    const transformToApply = transformsRaw.filter(
+      transform => !blacklist.includes(transform)
+    );
 
     let ast = regexp;
     if (regexp instanceof RegExp) {
diff --git a/src/regexp-tree.js b/src/regexp-tree.js
index 15c9844..c2b52da 100644
--- a/src/regexp-tree.js
+++ b/src/regexp-tree.js
@@ -68,9 +68,9 @@ const regexpTree = {
    *       ...
    *     },
    *   });
-	 *
-	 * The value for a node type may also be an object with functions pre and post.
-	 * This enables more context-aware analyses, e.g. measuring star height.
+   *
+   * The value for a node type may also be an object with functions pre and post.
+   * This enables more context-aware analyses, e.g. measuring star height.
    */
   traverse(ast, handlers, options) {
     return traverse.traverse(ast, handlers, options);
@@ -123,8 +123,8 @@ const regexpTree = {
    *
    * @return TransformResult object
    */
-  optimize(regexp, whitelist) {
-    return optimizer.optimize(regexp, whitelist);
+  optimize(regexp, whitelist, {blacklist} = {}) {
+    return optimizer.optimize(regexp, {whitelist, blacklist});
   },
 
   /**


Test patch:
diff --git a/src/optimizer/__tests__/optimizer-integration-test.js b/src/optimizer/__tests__/optimizer-integration-test.js
index 7123003..4237c1d 100644
--- a/src/optimizer/__tests__/optimizer-integration-test.js
+++ b/src/optimizer/__tests__/optimizer-integration-test.js
@@ -82,8 +82,26 @@ describe('optimizer-integration-test', () => {
     const original = '/(?:[a])/';
     const optimized = '/[a]/';
 
-    expect(optimizer.optimize(original, ['ungroup']).toString()).toBe(
-      optimized.toString()
-    );
+    expect(
+      optimizer.optimize(original, {whitelist: ['ungroup']}).toString()
+    ).toBe(optimized.toString());
+  });
+
+  it('sorts characters', () => {
+    const original = /[åä]/;
+    const optimized = /[äå]/;
+
+    expect(optimizer.optimize(original).toString()).toBe(optimized.toString());
+  });
+
+  it('preserves character order when blacklisted charClassClassrangesMerge', () => {
+    const original = /[åä]/;
+    const optimized = /[åä]/;
+
+    expect(
+      optimizer
+        .optimize(original, {blacklist: ['charClassClassrangesMerge']})
+        .toString()
+    ).toBe(optimized.toString());
   });
 });
Repository: DmitrySoshnikov/regexp-tree
Pull request #264 (2024-06-23 04:16:45)

fix: add support for `hasIndices` `/d` regex flag
The `hasIndices` or `/d` regex flag is part of ES2022.

> The `d` flag indicates that the result of a regular expression match should contain the start and end indices of the substrings of each capture group. It does not change the regex's interpretation or matching behavior in any way, but only provides additional information in the matching result.

See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/hasIndices


Patch:
diff --git a/src/compat-transpiler/runtime/index.js b/src/compat-transpiler/runtime/index.js
index 0f1e713..b2c084d 100644
--- a/src/compat-transpiler/runtime/index.js
+++ b/src/compat-transpiler/runtime/index.js
@@ -48,6 +48,7 @@ class RegExpTree {
     this.multiline = re.multiline;
     this.sticky = re.sticky;
     this.unicode = re.unicode;
+    this.hasIndices = re.hasIndices;
   }
 
   /**
@@ -97,4 +98,4 @@ class RegExpTree {
 
 module.exports = {
   RegExpTree,
-};
\ No newline at end of file
+};
diff --git a/src/parser/generated/regexp-tree.js b/src/parser/generated/regexp-tree.js
index faf9d33..aaa840d 100644
--- a/src/parser/generated/regexp-tree.js
+++ b/src/parser/generated/regexp-tree.js
@@ -1066,7 +1066,7 @@ function Char(value, kind, loc) {
  * Valid flags per current ECMAScript spec and
  * stage 3+ proposals.
  */
-const validFlags = 'gimsuxy';
+const validFlags = 'gimsuxyd';
 
 /**
  * Checks the flags are valid, and that
diff --git a/src/parser/regexp.bnf b/src/parser/regexp.bnf
index fcb4009..631e6d4 100644
--- a/src/parser/regexp.bnf
+++ b/src/parser/regexp.bnf
@@ -405,7 +405,7 @@ function Char(value, kind, loc) {
  * Valid flags per current ECMAScript spec and
  * stage 3+ proposals.
  */
-const validFlags = 'gimsuxy';
+const validFlags = 'gimsuxyd';
 
 /**
  * Checks the flags are valid, and that


Test patch:
diff --git a/src/parser/__tests__/parser-basic-test.js b/src/parser/__tests__/parser-basic-test.js
index ba4348b..91702e3 100644
--- a/src/parser/__tests__/parser-basic-test.js
+++ b/src/parser/__tests__/parser-basic-test.js
@@ -1076,6 +1076,22 @@ describe('basic', () => {
     });
   });
 
+  it('hasIndices (/d) flag', () => {
+    // Warning: Only supported in ES2022 or later (Node.JS v16)\
+    // Not using `re` helper here, since ESLint is only setup for ES6.
+    expect(parser.parse('/a/d')).toEqual({
+      type: 'RegExp',
+      body: {
+        type: 'Char',
+        value: 'a',
+        symbol: 'a',
+        kind: 'simple',
+        codePoint: 'a'.codePointAt(0),
+      },
+      flags: 'd',
+    });
+  });
+
   it('throws error on invalid Unicode escape', () => {
     expect(() => parser.parse('/\\p/u')).toThrowError(SyntaxError);
     expect(() => parser.parse('/\\e/u')).toThrowError(SyntaxError);
Repository: DmitrySoshnikov/regexp-tree
Pull request #269 (2025-07-15 09:38:22)

Optimize `a{0,1}` → `a?`


Patch:
diff --git a/src/optimizer/transforms/quantifier-range-to-symbol-transform.js b/src/optimizer/transforms/quantifier-range-to-symbol-transform.js
index 42503f5..95ff197 100644
--- a/src/optimizer/transforms/quantifier-range-to-symbol-transform.js
+++ b/src/optimizer/transforms/quantifier-range-to-symbol-transform.js
@@ -12,6 +12,7 @@
  * a{0,} -> a*
  * a{1,} -> a+
  * a{1} -> a
+ * a{0,1} -> a?
  *
  * NOTE: the following is automatically handled in the generator:
  *
@@ -33,6 +34,9 @@ module.exports = {
 
     // a{1} -> a
     rewriteExactOne(path);
+
+    // a{0,1} -> a?
+    rewriteZeroOne(path);
   }
 };
 
@@ -67,3 +71,14 @@ function rewriteExactOne(path) {
 
   path.parentPath.replace(path.parentPath.node.expression);
 }
+
+function rewriteZeroOne(path) {
+  const {node} = path;
+
+  if (node.from !== 0 || node.to !== 1) {
+    return;
+  }
+
+  node.kind = '?';
+  delete node.from;
+}


Test patch:
diff --git a/src/optimizer/transforms/__tests__/quantifier-range-to-symbol-transform-test.js b/src/optimizer/transforms/__tests__/quantifier-range-to-symbol-transform-test.js
index 5cc0428..d1d86fd 100644
--- a/src/optimizer/transforms/__tests__/quantifier-range-to-symbol-transform-test.js
+++ b/src/optimizer/transforms/__tests__/quantifier-range-to-symbol-transform-test.js
@@ -45,4 +45,11 @@ describe('quantifier range to symbol', () => {
     expect(re.toString()).toBe('/[a-z]{3}/');
   });
 
+  it('a{0,1} -> a?', () => {
+    const re = transform('/[a-z]{0,1}/', [
+      quantifierRangeToSymbol
+    ]);
+    expect(re.toString()).toBe('/[a-z]?/');
+  });
+
 });
\ No newline at end of file
Repository: DmitrySoshnikov/regexp-tree
Pull request #47 (2017-04-08 20:07:49)

add getParent() to NodePath
we need this
* to navigate to parent without knowing implementation details (NodePath, node.parent etc.)
* to have a consistent API


Patch:
diff --git a/src/traverse/README.md b/src/traverse/README.md
index 776f8e4..38480cc 100644
--- a/src/traverse/README.md
+++ b/src/traverse/README.md
@@ -52,3 +52,5 @@ Methods of the `NodePath`:
 * `update(nodeProps: Object)` - updates a node inline;
 * `getPreviousSibling()` - returns previous sibling path;
 * `getNextSibling()` - returns next sibling path;
+* `getChild(n: Number = 0)` - return `n`th child path;
+* `getParent()` - return parent path, for consistency, returns parentPath;
diff --git a/src/traverse/node-path.js b/src/traverse/node-path.js
index cdd2417..dfd196d 100644
--- a/src/traverse/node-path.js
+++ b/src/traverse/node-path.js
@@ -112,6 +112,30 @@ class NodePath {
     Object.assign(this.node, nodeProps);
   }
 
+  /**
+   * Returns parent.
+   */
+  getParent() {
+    return this.parentPath;
+  }
+
+  /**
+   * Returns nth child.
+   */
+  getChild(n = 0) {
+    if (this.node.expressions) {
+      return NodePath.getForNode(
+        this.node.expressions[n],
+        this,
+        "expressions",
+        n
+      );
+    } else if (this.node.expression && n == 0) {
+      return NodePath.getForNode(this.node.expression, this, "expression");
+    }
+    return null;
+  }
+
   /**
    * Returns previous sibling.
    */


Test patch:
diff --git a/src/traverse/__tests__/node-path-test.js b/src/traverse/__tests__/node-path-test.js
index a1a3dab..8c50af2 100644
--- a/src/traverse/__tests__/node-path-test.js
+++ b/src/traverse/__tests__/node-path-test.js
@@ -281,6 +281,42 @@ describe('NodePath', () => {
     );
 
     expect(aCharPath.getNextSibling()).toBe(bCharPath);
+
+  });
+
+  it('getParent/getChild', () => {
+    const ast = parser.parse('/a(bc)d/');
+
+    const bodyPath = NodePath.getForNode(ast.body);
+    const groupPath = bodyPath.getChild(1);
+
+    expect(groupPath.node.type).toBe("Group");
+    expect(groupPath.getParent()).toBe(bodyPath);
+
+    const alterPath = groupPath.getChild();
+
+    expect(alterPath.node.type).toBe("Alternative");
+    expect(alterPath.getParent()).toBe(groupPath);
+
+    const bCharPath = alterPath.getChild(0);
+    const cCharPath = alterPath.getChild(1);
+
+    expect(bCharPath.getParent()).toBe(alterPath);
+    expect(cCharPath.getParent()).toBe(alterPath);
+
+    expect(bCharPath.getParent().getParent()).toBe(groupPath);
+    expect(cCharPath.getParent().getParent()).toBe(groupPath);
+
+    expect(groupPath.getChild()).toBe(alterPath);
+    expect(groupPath.getChild(0)).toBe(alterPath);
+    expect(groupPath.getChild(1)).toBe(null);
+
+    expect(groupPath.getChild().getChild(0)).toBe(bCharPath);
+    expect(groupPath.getChild().getChild(1)).toBe(cCharPath);
+
+    expect(groupPath.getChild()).toBe(alterPath);
+    expect(groupPath.getChild(0)).toBe(alterPath);
+    expect(groupPath.getChild(1)).toBe(null);
   });
 
-});
\ No newline at end of file
+});
Repository: DmitrySoshnikov/regexp-tree
Pull request #70 (2017-05-04 11:42:17)

quantifier range boundaries check
refs #2


Patch:
diff --git a/src/parser/generated/regexp-tree.js b/src/parser/generated/regexp-tree.js
index 9fe7afb..93edd4b 100644
--- a/src/parser/generated/regexp-tree.js
+++ b/src/parser/generated/regexp-tree.js
@@ -836,7 +836,13 @@ yyparse.onParseBegin = (string, lexer) => {
  * Extracts ranges from the range string.
  */
 function getRange(text) {
-  return text.match(/\d+/g).map(Number);
+  const range = text.match(/\d+/g).map(Number);
+
+  if (Number.isFinite(range[1]) && range[1] < range[0]) {
+    throw new SyntaxError(`Numbers out of order in ${text} quantifier`);
+  }
+
+  return range;
 }
 
 /**
diff --git a/src/parser/regexp.bnf b/src/parser/regexp.bnf
index 08dbea8..87fe582 100644
--- a/src/parser/regexp.bnf
+++ b/src/parser/regexp.bnf
@@ -165,7 +165,13 @@ yyparse.onParseBegin = (string, lexer) => {
  * Extracts ranges from the range string.
  */
 function getRange(text) {
-  return text.match(/\d+/g).map(Number);
+  const range = text.match(/\d+/g).map(Number);
+
+  if (Number.isFinite(range[1]) && range[1] < range[0]) {
+    throw new SyntaxError(`Numbers out of order in ${text} quantifier`);
+  }
+
+  return range;
 }
 
 /**


Test patch:
diff --git a/src/parser/__tests__/parser-test262-test.js b/src/parser/__tests__/parser-test262-test.js
index 96d5cc2..cbb82fa 100644
--- a/src/parser/__tests__/parser-test262-test.js
+++ b/src/parser/__tests__/parser-test262-test.js
@@ -38,7 +38,7 @@ describe('test262', () => {
 
   it('invalid quantifier range', () => {
     // 15.10.2.5-3-1
-    // TODO: /0{2,1}/ - should throw, 1 is less than 2
+    invalid('/0{2,1}/', 'Numbers out of order');
   });
 
   it('invalid flags', () => {