weixin_39717598 2020-11-22 01:03
浏览 0

Code review request

From arthur....com on December 04, 2013 15:23:04

Branch name:test Purpose of code changes on this branch: Add test skeleton based on Node.js and Mocha. When reviewing my code changes, please focus on: 1. The dependency management part is quite messy right now. It relies on the test author to load all required dependencies. I can think of three ways to solve it:

a. build the provide/require/load mechanism inside FOAM b. use a script to auto-generate that part based on precooked dependency graph c. inside FOAM code, detect if Node.js is there. If so, do necessary modules.export and require. 1. The provided test currently fails on the aseq test. It seems to me that aseq returns prematurely without finishing all async functions. Need help to determine if this is a node.js issue or not, and how to overcome it. After the review, I'll merge this branch into: /master

Original issue: http://code.google.com/p/foam-framework/issues/detail?id=117

该提问来源于开源项目:foam-framework/foam

  • 写回答

5条回答 默认 最新

  • weixin_39717598 2020-11-22 01:03
    关注

    From k....org on December 04, 2013 12:36:36

    When I run this from the console:

    aseq(aseq(alog('1'), asleep(1000), alog('2'), asleep(1000), alog('3'), asleep(1000)), aseq(alog('a'), asleep(1000), alog('b'), asleep(1000), alog('c'), asleep(1000)))(alog('done'));

    It appears to work correctly.

    aseq() will return before its arguments return, that's why it's an asynchronous function. But it won't call it's 'ret' argument until they're done. Is that what you meant?

    Status: Accepted

    评论

报告相同问题?