Sha256: 00b31b5a74cde32ddafa4b97e13b7faaf1b750f4ec45de66b6ec73c6fccd7a43

Contents?: true

Size: 878 Bytes

Versions: 1

Compression:

Stored size: 878 Bytes

Contents

class @FunctionNode extends Node
  update: (data, map) ->
    @name    = data['name']
    @type    = @locate(data['return_type'], map)
    @present = false

    @arguments = data['argument_ids'].map (id) => @locate(id, map)

    @reassign @blockIds, data['basic_block_ids'], (removed, added) =>
      removed.each (id) => @locate(id, map).unlinkFunction(@)
      added.each   (id) => @locate(id, map).linkFunction(@)

    @blockIds = data['basic_block_ids']
    @blocks = @blockIds.map (id) => @locate(id, map)

  linkModule:   -> @present = true
  unlinkModule: -> @present = false

  attachedFunctions: ->
    result = {}
    result[@id] = @
    result

  title: ->
    template = if @present then 'nodes/function' else 'nodes/function_removed'

    JST[template]
      type: @type?.title() || '?'
      name: @name
      arguments: @arguments.map((x) -> x.title()).join(', ')

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
furnace-xray-1.1.0.pre2 lib/furnace-xray/app/assets/javascripts/lib/nodes/function.js.coffee