aboutsummaryrefslogtreecommitdiff
path: root/lib/mozilla-ast.js
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-10-05 15:05:06 +0300
committerMihai Bazon <mihai@bazon.net>2012-10-05 15:05:06 +0300
commitecd9f21467c32b6a0076a99bdd895cf37244683a (patch)
tree716fcd6fb57256171431626f5d883c98200b03c7 /lib/mozilla-ast.js
parenta9b6f9909a331740cae4a37f1fc6bb40801674fe (diff)
downloadtracifyjs-ecd9f21467c32b6a0076a99bdd895cf37244683a.tar.gz
tracifyjs-ecd9f21467c32b6a0076a99bdd895cf37244683a.zip
fixed import of locations from SpiderMonkey AST
Diffstat (limited to 'lib/mozilla-ast.js')
-rw-r--r--lib/mozilla-ast.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/mozilla-ast.js b/lib/mozilla-ast.js
index 41cf13ce..b92b2847 100644
--- a/lib/mozilla-ast.js
+++ b/lib/mozilla-ast.js
@@ -198,9 +198,9 @@
function my_start_token(moznode) {
return new AST_Token({
- file : moznode.loc.start.source,
- line : moznode.loc.start.line,
- col : moznode.loc.start.column,
+ file : moznode.loc && moznode.loc.source,
+ line : moznode.loc && moznode.loc.start.line,
+ col : moznode.loc && moznode.loc.start.column,
pos : moznode.start,
endpos : moznode.start
});
@@ -208,9 +208,9 @@
function my_end_token(moznode) {
return new AST_Token({
- file : moznode.loc.end.source,
- line : moznode.loc.end.line,
- col : moznode.loc.end.column,
+ file : moznode.loc && moznode.loc.source,
+ line : moznode.loc && moznode.loc.end.line,
+ col : moznode.loc && moznode.loc.end.column,
pos : moznode.end,
endpos : moznode.end
});