[Pkg-javascript-commits] [node-acorn-jsx] 286/484: [loose parser] Take brace-line indentation into account for objlit closing heuristic

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:44 UTC 2017


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

rouca pushed a commit to branch master
in repository node-acorn-jsx.

commit 49680b1c60f21751f5e09756fb78fb573a2e59f0
Author: Marijn Haverbeke <marijnh at gmail.com>
Date:   Mon Sep 22 15:15:12 2014 +0200

    [loose parser] Take brace-line indentation into account for objlit closing heuristic
---
 acorn_loose.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/acorn_loose.js b/acorn_loose.js
index e490eb2..c6b7f46 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -696,9 +696,10 @@
     var node = startNode();
     node.properties = [];
     pushCx();
+    var indent = curIndent + 1, line = curLineStart;
     next();
-    var propIndent = curIndent, line = curLineStart;
-    while (!closes(tt.braceR, propIndent + 1, line)) {
+    if (curIndent + 1 < indent) { indent = curIndent; line = curLineStart; }
+    while (!closes(tt.braceR, indent, line)) {
       var name = parsePropertyName();
       if (!name) { if (isDummy(parseExpression(true))) next(); eat(tt.comma); continue; }
       var prop = startNode();

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



More information about the Pkg-javascript-commits mailing list