Skip to content

Commit

Permalink
Revert "throw a TypeError if identifier validation fails (babel#10621)"
Browse files Browse the repository at this point in the history
This reverts commit c7d8b8a.
  • Loading branch information
nicolo-ribaudo committed Nov 5, 2019
1 parent 5f2240e commit 64d7bf4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
6 changes: 3 additions & 3 deletions packages/babel-types/src/definitions/core.js
@@ -1,5 +1,5 @@
// @flow
import isIdentifierName from "../validators/isIdentifierName";
import isValidIdentifier from "../validators/isValidIdentifier";

import {
BINARY_OPERATORS,
Expand Down Expand Up @@ -406,8 +406,8 @@ defineType("Identifier", {
...patternLikeCommon,
name: {
validate: chain(function(node, key, val) {
if (!isIdentifierName(val)) {
throw new TypeError(`"${val}" is not a valid identifer name`);
if (!isValidIdentifier(val)) {
// throw new TypeError(`"${val}" is not a valid identifer name`);
}
}, assertValueType("string")),
},
Expand Down
1 change: 0 additions & 1 deletion packages/babel-types/src/index.js
Expand Up @@ -109,7 +109,6 @@ export {
default as isValidES3Identifier,
} from "./validators/isValidES3Identifier";
export { default as isValidIdentifier } from "./validators/isValidIdentifier";
export { default as isIdentifierName } from "./validators/isIdentifierName";
export { default as isVar } from "./validators/isVar";
export { default as matchesPattern } from "./validators/matchesPattern";
export { default as validate } from "./validators/validate";
Expand Down
9 changes: 0 additions & 9 deletions packages/babel-types/src/validators/isIdentifierName.js

This file was deleted.

0 comments on commit 64d7bf4

Please sign in to comment.