benmerckx / genes

Generates split ES6 modules and Typescript definitions from Haxe modules.
44 stars 8 forks source link

Adds complexity to cycles tests to break them. #4

Closed Sanva closed 4 years ago

Sanva commented 4 years ago

Hi @benmerckx .

I'm not sure if you would want to merge this, feel free to discard it — it's only to show you a bug I can't understand how to solve, you might want to take a look at it.

By the way, this is an implementation that uses a pattern more or lees like the one exposed in this commit → https://github.com/haxetink/tink_streams/blob/master/src/tink/streams/Stream.hx#L263~L266 and https://github.com/haxetink/tink_streams/blob/master/src/tink/streams/Stream.hx#L394 (Empty is a StreamBase) .

Trying to run this test (or for example an app using Tink web clientside routers) breaks with someting like

file:///home/valentin/Escritorio/Work/sanva/genes/bin/genes/Register.js:39
              return assign(Object.assign(created, res, {class: created}))
                                   ^

RangeError: Maximum call stack size exceeded
    at Function.assign (<anonymous>)
    at Function.get (file:///home/valentin/Escritorio/Work/sanva/genes/bin/genes/Register.js:39:36)
    at new Object.defineProperties.class.get (file:///home/valentin/Escritorio/Work/sanva/genes/bin/genes/Register.js:27:40)
    at file:///home/valentin/Escritorio/Work/sanva/genes/bin/tests/TestCycle2.js:33:64
    at Function.get [as inst] (file:///home/valentin/Escritorio/Work/sanva/genes/bin/genes/Register.js:10:13)
    at Function.assign (<anonymous>)
    at Function.get (file:///home/valentin/Escritorio/Work/sanva/genes/bin/genes/Register.js:39:36)
    at new Object.defineProperties.class.get (file:///home/valentin/Escritorio/Work/sanva/genes/bin/genes/Register.js:27:40)
    at file:///home/valentin/Escritorio/Work/sanva/genes/bin/tests/TestCycle2.js:33:64
    at Function.get [as inst] (file:///home/valentin/Escritorio/Work/sanva/genes/bin/genes/Register.js:10:13)
benmerckx commented 4 years ago

I've hopefully addressed this in the last commit, could you test that with your setup?

Sanva commented 4 years ago

@benmerckx yes, now it works! I can even use tink_web clientside routers :tada: