Sha256: 747908ec22e25687a6633e0460fdd038921a8d372e4a54f9f627ef4131a760b9
Contents?: true
Size: 1.24 KB
Versions: 19
Compression:
Stored size: 1.24 KB
Contents
Entity = require '../entity' Entities = require '../_entities' Winston = require 'winston' module.exports = class Entities.Variable extends Entity @name: "Variable" @looksLike: (node) -> node.constructor.name == 'Assign' && node.value?.constructor.name == 'Value' && node.variable?.base?.value? && node.value.base.constructor.name isnt 'Call' @is: (node) -> !node.documentation?.property && !node.documentation?.mixin && super(node) constructor: (@environment, @file, @node) -> [@name, @selfish] = @fetchName() @constant = /^[A-Z_-]*$/.test @name try @value = @node.value.base.compile indent: '' # Workaround to replace CoffeeScript internal # representations with something reasonable @value = 'undefined' if @value == 'void 0' @documentation = @node.documentation if @environment.options.debug Winston.info "Creating new Variable Entity" Winston.info " name: " + @name Winston.info " documentation: " + @documentation inspect: -> { file: @file.path name: @name constant: @constant value: @value documentation: @documentation?.inspect() selfish: @selfish kind: @kind }
Version data entries
19 entries across 19 versions & 1 rubygems