• 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.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.test.coffee path.test.coffee process.test.coffee encoding.test.coffee globals.test.coffee
  • Function.litcoffee

  • ¶

    Adds helper methods to the native javascript Function class

    Function::ctor params…

    Creates a new object from the parent function

    Function::ctor   = (params...)->
        new @(params...)
  • ¶

    Function::invoke params…

    Invokes the function with the provided params. Note that the this object is set to null

    Function::invoke = (params...)->
        @.apply(null, params)
  • ¶

    Function::invoke_In value

    Invokes the function in value miliseconds

    Function::invoke_In = (value)->
        setTimeout @, value
  • ¶

    Function::new params …

    Function::new    = Function::ctor
  • ¶

    Function::sourceCode

    Returns the source code of the current function. This done using an easy trick which is usually not that obvious. All we have to do is to call the .toString() method of the function (another option is to append the function to a string @ + "")

    twin methods: sourceCode

    Function::source_Code = ()->
        @.toString()
    
    Function::sourceCode = Function::source_Code
  • ¶

  • ¶

    back to index