ysmood / nokit

A light weight set of handy tools for real world program.
51 stars 6 forks source link

一个关于 kit.log 和 colors 的神奇bug #8

Closed dracupid closed 9 years ago

dracupid commented 9 years ago

使用coffee运行以下代码 nokit@0.9.5

kit = require 'nokit'
require 'colors'
kit.log '123'
module.exports =  ->
    builder = 123
    # 锕

抛出 ReferenceError: builder is not defined

这个结果我看来是十分荒谬的 :fearful: ,因为当以下条件任一满足时错误不会出现:

求解 :question: `

dracupid commented 9 years ago

使用node 0.12.7 io 2.5.0 和 3.0.0都出现问题

ysmood commented 9 years ago

这个问题 @hustKiwi 也碰到过,当时测试了很久断定是 coffee 中文编码的问题。

ysmood commented 9 years ago

@dracupid 另外鉴于 colors bug 众多,nokit 最新版已经废用它了,切换到新的 kit.brush 并不复杂。

dracupid commented 9 years ago

了解。colors在npm上也已经被chalk超过了。

ysmood commented 9 years ago

我这边只给出了最基本的支持,如果有更复杂的需求,chalk 是非常不错的,它唯一的缺点就是依赖太多,难以掌握全部特性。