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

Fails to load a Table grammar inside a paragraph #718

Open
csMACnz opened this issue Aug 17, 2017 · 1 comment
Open

Fails to load a Table grammar inside a paragraph #718

csMACnz opened this issue Aug 17, 2017 · 1 comment

Comments

@csMACnz
Copy link

csMACnz commented Aug 17, 2017

It caused errors when adding the paragraph grammar, then once added and saved, it causes catastrophic failure (see stacktrace below)

I have one IGrammar method using Paragraph with x += this["TableMethod"].
I have the TableMethod IGrammar using either this["Item"].AsTable("Table") or using CreateNewObject(...).AsTable("Table"). Both fail with this issue.

Tested with various recent versions, still fails with Storyteller Version=4.3.1 and dotnet-storyteller Version=1.1.2

 TypeError: this.children[0].selectFirst is not a function
    at Paragraph.selectFirst (paragraph.js:159)
    at Paragraph.selectFirst (paragraph.js:159)
    at Step.selectFirst (step.js:205)
    at Section.StepHolder.self.selectFirst (step-holder.js:158)
    at SpecificationNavigator.moveFirst (specification-navigator.js:86)
    at new Specification (specification.js:342)
    at new SpecRecord (spec-record.js:33)
    at eval (hierarchy-loaded.js:12)
    at Array.forEach (<anonymous>)
    at HierarchyLoaded (hierarchy-loaded.js:11)

(Possibly related to #415)

@csMACnz
Copy link
Author

csMACnz commented Aug 17, 2017

hmmm, i may have been seeing two instances of the same bug in two places.
I suggest investigation around CreateNewObject inside a Grammar, used inside a paragraph potentially causing the above. It looks from above that the this is the grammar, inside the paragraph, but the this.children[0] is the silent grammar from _.ObjectIs = c => new T(); inside CreateNewObject (

_.ObjectIs = c => new T();
)

My workaround for now is avoid CreateNewObject and set up CurrentObject management seperately.

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

1 participant