Skip to content

Commit 795da7e

Browse files
authored
Merge pull request #7501 from plotly/cam/specify-acorn-ecmaVersion
Add ECMAScript version to Falafel/Acorn.js config
2 parents 415a1fc + a629ed6 commit 795da7e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

tasks/find_locale_strings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function findLocaleStrings() {
2828
var code = fs.readFileSync(file, 'utf-8');
2929
var filePartialPath = file.substr(constants.pathToSrc.length);
3030

31-
falafel(code, {locations: true}, function(node) {
31+
falafel(code, { ecmaVersion: 'latest', locations: true }, function(node) {
3232
if(node.type === 'CallExpression' &&
3333
(node.callee.name === '_' || node.callee.source() === 'Lib._')
3434
) {

tasks/shard_jasmine_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ glob(path.join(pathToJasmineTests, '*.js')).then((files) => {
2929
var code = fs.readFileSync(file, 'utf-8');
3030
var bn = path.basename(file);
3131

32-
falafel(code, function(node) {
32+
falafel(code, { ecmaVersion: 'latest' }, function(node) {
3333
if(isJasmineTestIt(node, tag)) {
3434
if(file2cnt[bn]) {
3535
file2cnt[bn]++;

tasks/test_syntax.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function assertJasmineSuites() {
4242
var code = fs.readFileSync(file, 'utf-8');
4343
var bn = path.basename(file);
4444

45-
falafel(code, {locations: true}, function(node) {
45+
falafel(code, { ecmaVersion: 'latest', locations: true }, function(node) {
4646
var lineInfo = '[line ' + node.loc.start.line + '] :';
4747

4848
if(node.type === 'Identifier' && BLACK_LIST.indexOf(node.name) !== -1) {
@@ -108,7 +108,7 @@ function assertSrcContents() {
108108

109109
// parse through code string while keeping track of comments
110110
var comments = [];
111-
falafel(code, {onComment: comments, locations: true}, function(node) {
111+
falafel(code, { ecmaVersion: 'latest', locations: true, onComment: comments }, function(node) {
112112
// look for .classList
113113
if(node.type === 'MemberExpression') {
114114
var source = node.source();

tasks/util/update_version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var pkg = require('../../package.json');
77

88
module.exports = function updateVersion(pathToFile) {
99
fs.readFile(pathToFile, 'utf-8', function(err, code) {
10-
var out = falafel(code, function(node) {
10+
var out = falafel(code, { ecmaVersion: 'latest' }, function(node) {
1111
if(isVersionNode(node)) node.update('\'' + pkg.version + '\'');
1212
});
1313

0 commit comments

Comments
 (0)