Skip to content

Commit

Permalink
fixed #133
Browse files Browse the repository at this point in the history
  • Loading branch information
atsepkov committed Nov 24, 2016
1 parent 5287647 commit b374852
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rapydscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -7273,7 +7273,7 @@ var ՐՏ_modules = {};
if (start && !start._comments_dumped) {
start._comments_dumped = true;
comments = start.comments_before;
if (self instanceof ast.Exit && self.value && self.value.start.comments_before.length > 0) {
if (self instanceof ast.Exit && self.value && self.value.start.comments_before && self.value.start.comments_before.length > 0) {
comments = (comments || []).concat(self.value.start.comments_before);
self.value.start.comments_before = [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/output.pyj
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def Stream(options):
# XXX: ugly fix for https://github.com/mishoo/RapydScript2/issues/112
# if this node is `return` or `throw`, we cannot allow comments before
# the returned or thrown value.
if isinstance(self, ast.Exit) and self.value and self.value.start.comments_before.length > 0:
if isinstance(self, ast.Exit) and self.value and self.value.start.comments_before and self.value.start.comments_before.length > 0:
comments = (comments or []).concat(self.value.start.comments_before)
self.value.start.comments_before = []

Expand Down

0 comments on commit b374852

Please sign in to comment.