Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo: identifer -> identifier #10647

Merged
merged 2 commits into from Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/babel-generator/test/index.js
Expand Up @@ -197,7 +197,7 @@ describe("generation", function() {

const id2 = fn.body.body[0].expression;
id2.name += "2";
id2.loc.identiferName = "bar";
id2.loc.identifierName = "bar";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't fail because if name !== identifierName, @babel/generator uses name. Good catch!


const generated = generate(
ast,
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-parser/src/parser/expression.js
Expand Up @@ -384,7 +384,7 @@ export default class ExpressionParser extends LValParser {
* so for ?? operator we need to check in this case the right expression to have parenthesis
* second case a && b ?? c
* here a && b => This is considered as a logical expression in the ast tree
* c => identifer
* c => identifier
* so now here for ?? operator we need to check the left expression to have parenthesis
* if the parenthesis is missing we raise an error and throw it
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-types/src/definitions/core.js
Expand Up @@ -407,7 +407,7 @@ defineType("Identifier", {
name: {
validate: chain(function(node, key, val) {
if (!isValidIdentifier(val)) {
// throw new TypeError(`"${val}" is not a valid identifer name`);
// throw new TypeError(`"${val}" is not a valid identifier name`);
}
}, assertValueType("string")),
},
Expand Down