Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using Gulp+RapydScript: TypeError: Cannot read property 'comments_before' of undefined #133

Open
carlosarmentac opened this issue Nov 23, 2016 · 3 comments

Comments

@carlosarmentac
Copy link

I have an error when I run a Gulp task with some codes (the most simple codes compiles ok). If I compile the code using the CLI all is good.

{ [TypeError: Cannot read property 'comments_before' of undefined] name: 'TypeError', message: 'Cannot read property \'comments_before\' of undefined', stack: 'TypeError: Cannot read property \'comments_before\' of undefined\n at Throw.ast.Node.add_comments (node_modules/rapydscript/lib/rapydscript.js:7276:83)\n at Throw.ast.Node.print (node_modules/rapydscript/lib/rapydscript.js:7254:22)\n at node_modules/rapydscript/lib/rapydscript.js:7435:26\n at Array.forEach (native)\n at display_body (node_modules/rapydscript/lib/rapydscript.js:7432:18)\n at display_complex_body (node_modules/rapydscript/lib/rapydscript.js:7590:13)\n at node_modules/rapydscript/lib/rapydscript.js:7779:25\n at node_modules/rapydscript/lib/rapydscript.js:6939:23\n at Stream.with_indent (node_modules/rapydscript/lib/rapydscript.js:6832:20)\n at Object.with_block (node_modules/rapydscript/lib/rapydscript.js:6938:13)',

I could run my gulp task commenting out this code (line 7276 in rapydscript.js):
Line 7276
/* if (self instanceof ast.Exit && self.value && self.value.start.comments_before.length > 0) { comments = (comments || []).concat(self.value.start.comments_before); self.value.start.comments_before = []; }*/

Best regards.

@atsepkov
Copy link
Owner

Should be fixed now.

@carlosarmentac
Copy link
Author

Hi Atsepkov, In my case, the error still happen.

[10:41:25] { TypeError: Cannot set property 'comments_before' of undefined at Throw.ast.Node.add_comments (node_modules\rapydscript\lib\rapydscr ipt.js:7278:58)

I modify the rapydscript.js this way:
Line 7276
if (self instanceof ast.Exit && self.value) { comments = (comments || []); //self.value.start.comments_before = []; }
And then it is working fine.

I have installed the version: "rapydscript": "^0.5.55"
rapydscript.js.txt

@atsepkov
Copy link
Owner

Ok, I'll take a look again.

@atsepkov atsepkov reopened this Nov 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants