LivelyKernel / LivelyKernel/lively.ast

Errors when using `printAst` and other helper methods related to parsed ASTs

Open
#9 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

In versions 0.9.0 and up, I can't successfully call any of the AST helper methods.

> var ast = require('lively.ast')
undefined
> ast.printAst(ast.parse("1 + 2"))
TypeError: Cannot read property 'string' of undefined
    at Object.printAst (<yadda\yadda>\node_modules\lively.ast\dist\lively.ast.js:12910:23)
    at repl:1:5
    at sigintHandlersWrap (vm.js:32:31)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInContext (vm.js:31:12)
    at REPLServer.defaultEval (repl.js:308:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:489:10)
    at emitOne (events.js:101:20)
>

The code above works fine if I use 0.8.1.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with lively.ast 0.9.0 or later using ast.parse("1 + 2") followed by ast.printAst, then inspect dist/lively.ast.js at the reported printAst location. Compare the behavior with version 0.8.1 and check whether the other AST helper methods fail similarly; done means these helpers no longer throw for parsed ASTs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.