stanford-oval/thingtalk

Programs with classes fail to be cloned

Closed this issue · 0 comments

If you try to .clone() a program with an embedded classdef (a remote program), and then prettyprint() it, you get:

TypeError: Cannot read property 'imports' of undefined
    at prettyprintClassDef (/home/gcampagn/mobisocial/thingengine-core/node_modules/thingtalk/lib/prettyprint.js:280:23)
    at prefix.{
.ast.classes.map (/home/gcampagn/mobisocial/thingengine-core/node_modules/thingtalk/lib/prettyprint.js:315:36)
    at Array.map (<anonymous>)
    at prettyprintProgram (/home/gcampagn/mobisocial/thingengine-core/node_modules/thingtalk/lib/prettyprint.js:315:25)
    at prettyprint (/home/gcampagn/mobisocial/thingengine-core/node_modules/thingtalk/lib/prettyprint.js:375:16)
    at C.Ast.Input.prettyprint (/home/gcampagn/mobisocial/thingengine-core/node_modules/thingtalk/lib/ast/api.js:129:12)