Keenwon

Results 45 comments of Keenwon

> 定位到开头的题目,流程如下: > 1. 当前task运行,执行代码。首先setTimeout的callback被添加到tasks queue中; > 2. 实例化promise,输出 1; promise resolved;输出 2; > 3. promise.then的callback被添加到microtasks queue中; > 4. 输出 3; > 5. 已到当前task的end,执行microtasks,输出 5; > 6. 执行下一个task,输出4。 关于第2,3步,不是promise.resolve()的时候,promise.then的callback**已经**被添加到microtask queue了吗?然后输出2,然后跳到第四步输出3.

@mqliutie 你这例子不对吧?你的 `setTimeout` 在 `new Promise` 内部呀,大兄弟;`setTimeout` 不执行 `then` 也永远不执行,这是有明显的先后顺序的

![image](https://cloud.githubusercontent.com/assets/5516478/25479378/3102f956-2b77-11e7-8526-3c180996e55a.png) ![image](https://cloud.githubusercontent.com/assets/5516478/25479403/455d5004-2b77-11e7-8e05-8cd898b8c29c.png)

试试去掉 test https://github.com/keenwon/antcolony/blob/master/Gruntfile.js#L108

这是你自己写的吧?你直接把你找到的地址,写到 `src/male.js` 就好了

目前的分页逻辑,没有考虑这种情况,因为 `totalCounts` 为 0 的时候,是不该显示 jqPaginator 分页

@lirenhao 因为 totalCounts 不能为空

```js if (!opts.totalPages && !opts.totalCounts) { throw new Error('[jqPaginator] totalCounts or totalPages is required'); } ``` 就是这样判断的。