   isSame: (aOptions)->
     #deepEqual @, aOptions
     for k,v of @mergeOptions()
-      continue if k is 'name'
-      ###
-      if k is 'encoding'
-        if (v.name isnt Type.DEFAULT_ENCODING.name) or aOptions[k]?
-          return false unless aOptions[k].name is v.name
-        continue
-      ###
       return false unless deepEqual aOptions[k], v
     return true
 

    aOptions = {} unless isObject aOptions

    if isString aExclude
      aExclude = getObjectKeys(aOptions).concat aExclude
    else if isArray aExclude
      aExclude = aExclude.concat getObjectKeys(aOptions)
    else
      aExclude = getObjectKeys(aOptions)
    aExclude.push 'name'

    if @$attributes
      @$attributes.assignTo(@, aOptions, aExclude, aSerialized)
      #aOptions.encoding = @encoding unless aOptions.encoding
    else
      extend aOptions, @, (key, value)->
        result = not aOptions.hasOwnProperty(key) and not (key in aExclude)
        if aSerialized
          result = result and key[0] isnt '$' and value isnt undefined
        result
    #delete aOptions.name
    aOptions
  _validate: (aValue, aOptions)->true
  error: (aMessage, aOptions)->

      return createObject aType.ValueType, aValue, aType, aOptions
    defineProperty @, '$type', aType
    @_initialize(aValue, aType, aOptions)
    @assign(aValue, aOptions)
  isValid: ()->@$type.isValid(@valueOf())
  _initialize: (aValue, aType, aOptions)->
    defineProperty @, 'value', null
