[Pkg-javascript-commits] [acorn] 02/08: New upstream version 4.0.4

Julien Puydt julien.puydt at laposte.net
Tue Feb 14 06:19:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

jpuydt-guest pushed a commit to branch master
in repository acorn.

commit bc813b1bb94d6ea2026a00e0d9bee02f242e6ab5
Author: Julien Puydt <julien.puydt at laposte.net>
Date:   Wed Jan 11 10:41:04 2017 +0100

    New upstream version 4.0.4
---
 .npmignore             | 7 +++++++
 AUTHORS                | 2 ++
 CHANGELOG.md           | 9 +++++++++
 package.json           | 2 +-
 rollup/config.loose.js | 2 +-
 src/index.js           | 2 +-
 src/statement.js       | 7 ++++++-
 test/tests-harmony.js  | 3 +++
 8 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/.npmignore b/.npmignore
index ecba291..eb3644b 100644
--- a/.npmignore
+++ b/.npmignore
@@ -1,3 +1,10 @@
 /.tern-port
 /test
 /local
+/rollup
+/bin/generate-identifier-regex.js
+/bin/update_authors.sh
+.editorconfig
+.gitattributes
+.tern-project
+.travis.yml
diff --git a/AUTHORS b/AUTHORS
index 314d708..3064045 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -25,6 +25,7 @@ Joel Kemp
 Johannes Herr
 Jordan Klassen
 Jürg Lehni
+Kai Cataldo
 keeyipchan
 Keheliya Gallaba
 Kevin Irish
@@ -32,6 +33,7 @@ Kevin Kwok
 krator
 Marijn Haverbeke
 Martin Carlberg
+Mat Garcia
 Mathias Bynens
 Mathieu 'p01' Henri
 Matthew Bastien
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 07bfaff..65c50a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+## 4.0.4 (2016-12-19)
+
+### Bug fixes
+
+Fix issue with loading acorn_loose.js with an AMD loader.
+
+Fix crash when `export` was followed by a keyword that can't be
+exported.
+
 ## 4.0.3 (2016-08-16)
 
 ### Bug fixes
diff --git a/package.json b/package.json
index 4037999..dedbd9e 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "homepage": "https://github.com/ternjs/acorn",
   "main": "dist/acorn.js",
   "jsnext:main": "dist/acorn.es.js",
-  "version": "4.0.3",
+  "version": "4.0.4",
   "engines": {
     "node": ">=0.4.0"
   },
diff --git a/rollup/config.loose.js b/rollup/config.loose.js
index 273e7a9..2ae018a 100644
--- a/rollup/config.loose.js
+++ b/rollup/config.loose.js
@@ -3,7 +3,7 @@ import {resolve} from 'path'
 
 var acorn = resolve('src/index.js')
 var paths = {}, globals = {}
-paths[acorn] = './acorn.js'
+paths[acorn] = './acorn'
 globals[acorn] = 'acorn'
 
 export default {
diff --git a/src/index.js b/src/index.js
index 189bf5a..9debb0a 100644
--- a/src/index.js
+++ b/src/index.js
@@ -36,7 +36,7 @@ export {isIdentifierChar, isIdentifierStart} from "./identifier"
 export {Token} from "./tokenize"
 export {isNewLine, lineBreak, lineBreakG} from "./whitespace"
 
-export const version = "4.0.3"
+export const version = "4.0.4"
 
 // The main exported interface (under `self.acorn` when in the
 // browser) is a `parse` function that takes a code string and
diff --git a/src/statement.js b/src/statement.js
index 7a660f1..3cd2916 100644
--- a/src/statement.js
+++ b/src/statement.js
@@ -655,7 +655,12 @@ pp.checkVariableExport = function(exports, decls) {
 }
 
 pp.shouldParseExportStatement = function() {
-  return this.type.keyword || this.isLet() || this.isAsyncFunction()
+  return this.type.keyword === "var"
+    || this.type.keyword === "const"
+    || this.type.keyword === "class"
+    || this.type.keyword === "function"
+    || this.isLet()
+    || this.isAsyncFunction()
 }
 
 // Parses a comma-separated list of module exports.
diff --git a/test/tests-harmony.js b/test/tests-harmony.js
index 79cdc2b..ddd27d5 100644
--- a/test/tests-harmony.js
+++ b/test/tests-harmony.js
@@ -4116,6 +4116,9 @@ test("export class Class {}", {
   locations: true
 });
 
+testFail("export new Foo();", "Unexpected token (1:7)", {ecmaVersion: 6, sourceType: "module"});
+testFail("export typeof foo;", "Unexpected token (1:7)", {ecmaVersion: 6, sourceType: "module"});
+
 test("export default 42", {
   type: "Program",
   body: [{

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/acorn.git



More information about the Pkg-javascript-commits mailing list