• Jump To … +
    assert_Array.litcoffee assert_Boolean.litcoffee assert_Function.litcoffee assert_Number.litcoffee assert_Object.litcoffee assert_String.litcoffee fluentnode.coffee index.md Array.litcoffee Boolean.litcoffee Function.litcoffee Number.litcoffee Object.litcoffee String.litcoffee console.litcoffee crypto.litcoffee fs.litcoffee http.GET.litcoffee http.POST.litcoffee http.Server.litcoffee http.litcoffee path.litcoffee process.litcoffee encoding.litcoffee globals.litcoffee assert_Array.test.coffee assert_Boolean.test.coffee assert_Function.test.coffee assert_Number.test.coffee assert_Object.test.coffee assert_String.test.coffee fluentnode.test.coffee Array.test.coffee Boolean.test.coffee Function.test.coffee Number.test.coffee Object.test.coffee String.test.coffee console.test.coffee crypto.test.coffee fs.test.coffee http.GET.test.coffee http.POST.test.coffee http.Server.test.coffee http.test.coffee path.test.coffee process.test.coffee encoding.test.coffee globals.test.coffee
  • console.litcoffee

  • ¶
    Object.defineProperty Object.prototype, 'console_log',
        enumerable  : false,
        writable    : true,
        value: ->
            value = @.toString()    # Dinis: I'm still not sure why this is needed
            console.log(value)
            return value
    
    Object.defineProperty String.prototype, 'log',
        enumerable  : false,
        writable    : true,
        value: Object::console_log
  • ¶

    not working of with side effects:

    Object.defineProperty Object.prototype, '_log',
        enumerable  : false,
        writable    : true,
        value: Object::console_log
    
    
    Object::console_log = ->
                                value = @.toString()
                                console.log(value)
                                return value
    
    Object::log         = Object::console_log
    

  • ¶

    back to index