From 60a625ada5bbdab5ed999191781219716cf42157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Thu, 18 Jul 2019 11:55:38 +0200 Subject: [PATCH] Add ECMA version option to acorn parser options. --- .../lib/translations/findoriginalstrings.js | 1 + .../ckeditor5-dev-utils/lib/translations/translatesource.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ckeditor5-dev-utils/lib/translations/findoriginalstrings.js b/packages/ckeditor5-dev-utils/lib/translations/findoriginalstrings.js index 0c9c8c88c..12c264732 100644 --- a/packages/ckeditor5-dev-utils/lib/translations/findoriginalstrings.js +++ b/packages/ckeditor5-dev-utils/lib/translations/findoriginalstrings.js @@ -12,6 +12,7 @@ const logger = require( '../logger' )(); module.exports = function findOriginalStrings( source ) { const ast = acorn.parse( source, { sourceType: 'module', + ecmaVersion: '2018' } ); const originalStrings = []; diff --git a/packages/ckeditor5-dev-utils/lib/translations/translatesource.js b/packages/ckeditor5-dev-utils/lib/translations/translatesource.js index c18db59ef..4feea3bc1 100644 --- a/packages/ckeditor5-dev-utils/lib/translations/translatesource.js +++ b/packages/ckeditor5-dev-utils/lib/translations/translatesource.js @@ -26,7 +26,8 @@ module.exports = function translateSource( source, sourceFile, translateString ) sourceType: 'module', ranges: true, onComment: comments, - onToken: tokens + onToken: tokens, + ecmaVersion: '2018' } ); let changesInCode = false;