[javascriptlint-commit] SF.net SVN: javascriptlint: [201] trunk
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2008-05-14 16:04:17
|
Revision: 201
http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=201&view=rev
Author: matthiasmiller
Date: 2008-05-14 09:04:10 -0700 (Wed, 14 May 2008)
Log Message:
-----------
fix reporting of syntax errors
Modified Paths:
--------------
trunk/pyjsl/jsparse.py
trunk/pyjsl/lint.py
trunk/pyspidermonkey/pyspidermonkey.c
Modified: trunk/pyjsl/jsparse.py
===================================================================
--- trunk/pyjsl/jsparse.py 2008-05-06 15:59:24 UTC (rev 200)
+++ trunk/pyjsl/jsparse.py 2008-05-14 16:04:10 UTC (rev 201)
@@ -199,7 +199,8 @@
nodes.pop()
root_node = pyspidermonkey.parse(script, _Node, _wrapped_callback)
- process(root_node)
+ if root_node:
+ process(root_node)
comments = _parse_comments(script, root_node, positions, comment_ignore_ranges)
return root_node, comments
Modified: trunk/pyjsl/lint.py
===================================================================
--- trunk/pyjsl/lint.py 2008-05-06 15:59:24 UTC (rev 200)
+++ trunk/pyjsl/lint.py 2008-05-14 16:04:10 UTC (rev 201)
@@ -75,7 +75,8 @@
class Scope:
def __init__(self, node):
- self._is_with_scope = node.kind == tok.WITH
+ """ node may be None """
+ self._is_with_scope = node and node.kind == tok.WITH
self._parent = None
self._kids = []
self._identifiers = {}
@@ -116,6 +117,9 @@
identifiers.append(node)
return identifiers
def find_scope(self, node):
+ if not self._node:
+ return None
+
for kid in self._kids:
scope = kid.find_scope(node)
if scope:
@@ -233,7 +237,8 @@
visitation.make_visitors(visitors, [_get_scope_checks(scope, report)])
# kickoff!
- _lint_node(root, visitors)
+ if root:
+ _lint_node(root, visitors)
# Process imports by copying global declarations into the universal scope.
imports |= set(conf['declarations'])
Modified: trunk/pyspidermonkey/pyspidermonkey.c
===================================================================
--- trunk/pyspidermonkey/pyspidermonkey.c 2008-05-06 15:59:24 UTC (rev 200)
+++ trunk/pyspidermonkey/pyspidermonkey.c 2008-05-14 16:04:10 UTC (rev 201)
@@ -423,8 +423,10 @@
m.jsnode = js_ParseTokenStream(m.context, m.global, m.token_stream);
if (!m.jsnode) {
- error = "parse error in file";
- goto cleanup;
+ if (!JS_ReportPendingException(m.context)) {
+ error = "parse error in file";
+ goto cleanup;
+ }
}
m.pynode = jsnode_to_pynode(m.context, m.jsnode);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|