-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
v7 Regression
First check out: https://new.babeljs.io/docs/en/next/v7-migration.html
Also a partial upgrade tool: https://github.com/babel/babel-upgrade
Potential Commit/PR that introduced the regression
Somewhere between v6 and v7 - not quite sure though… also the cafe is closing so i don't have time to investigate further, sorry!
Describe the regression
AST generation fails for ALLCAPS strings. I think it should not. 🤔
Input Code
var template = require("@babel/template");
const string = "var a = { a: 'NormalString', b: 'UPPERCASESTRING' };"
console.log(template.default(string)())This throws:
Error: @babel/template placeholder "UPPERCASESTRING": Expected string substitution
var template = require("babel-template");
const string = "var a = { a: 'NormalString', b: 'UPPERCASESTRING' };"
console.log(template(string)())This works flawlessly.
Babel Configuration (.babelrc, package.json, cli command)
none
Expected behavior/code
It should create an AST normally, taking into account that 'UPPERCASESTRING' is just a string.
Environment
- Babel version(s): In REPL 7.0.0-beta.49
- Node/npm version: Tested in node 9 + 10
- OS: OSX (local) + linux/amd64 (REPL)
- Monorepo (does not matter?)
- How you are using Babel: babel/template directly in babel-plugin-codegen
Thanks a ton! 🎉 ❤️
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue