src/engine/inject/accessors.js
function accessor (data) {
      // Behave like a setter if an argument is provided.
      if (arguments.length === 1) {
        var json = JSON.stringify(data)

        if (no(json)) {
          throw new Error('JSON do not serialize data:' + data)
        }

        graph.data[accessorName] = data
      }

      // Always behave also like a getter.
      return graph.data[accessorName]
    }
function accessor (data) {
      // Behave like a setter if an argument is provided.
      if (arguments.length === 1) {
        var json = JSON.stringify(data)

        if (no(json)) {
          throw new Error('JSON do not serialize data:' + data)
        }

        graph.data[accessorName] = data
      }

      // Always behave also like a getter.
      return graph.data[accessorName]
    }
function accessor ( data ) { // Behave like a setter if an argument is provided. if ( arguments . length === 1 ) { var json = JSON . stringify ( data ) if ( no ( json ) ) { throw new Error ( 'JSON do not serialize data:' + data ) } graph . data [ accessorName ] = data } // Always behave also like a getter. return graph . data [ accessorName ] }
Accessor-like function.

@param {*} data that JSON can serialize
Accessor - like function .