Closed zj8487 closed 9 years ago
不是的,这个第三方库,不能这么使用的,需要用一个类似 requireUtil 这个代理,通过注入这个,来拿到 Promise ,具体可以参考 bearcat-browserify-jquery
即使使用requireUtil的方式,还是不支持我上面的函数定义方式啊
恩,因为你这个是加载文件直接运行的,是不支持
不过这个 Promise 是全局的,可以向 cocos2d-js 这样,事先加载个 umd 模式的 Promise 到 global 应该是可以的,bearcat 是不处理这个的,但是可以自己配置
你的意思是放到jslist里面?
就像bearcat一样啊,require 进来 然后 window.bearcat = bearcat 即可。。。
测试环境基于bearcat-cocos2d-js-example。
1,npm install bluebird --save,并修改client.js如下:
2,在bearcat-cocos2d-js-example/app-client目录中添加个testBean.js 如下:
3,grunt命令,Promise.coroutine 这里报错:undefine is not a function.