src/notevil/index.js
function setValue(object, left, right, operator){
    var name = null

    if (left.type === 'Identifier'){
      name = left.name
      // handle parent context shadowing
      object = objectForKey(object, name, primitives)
    } else if (left.type === 'MemberExpression'){
      if (left.computed){
        name = walk(left.property)
      } else {
        name = left.property.name
      }
      object = walk(left.object)
    }

    // stop built in properties from being able to be changed
    if (canSetProperty(object, name, primitives)){
      switch(operator) {
        case undefined: return object[name] = walk(right)
        case '=':  return object[name] = walk(right)
        case '+=': return object[name] += walk(right)
        case '-=': return object[name] -= walk(right)
        case '++': return object[name]++
        case '--': return object[name]--
      }
    }

  }
function setValue(object, left, right, operator){
    var name = null

    if (left.type === 'Identifier'){
      name = left.name
      // handle parent context shadowing
      object = objectForKey(object, name, primitives)
    } else if (left.type === 'MemberExpression'){
      if (left.computed){
        name = walk(left.property)
      } else {
        name = left.property.name
      }
      object = walk(left.object)
    }

    // stop built in properties from being able to be changed
    if (canSetProperty(object, name, primitives)){
      switch(operator) {
        case undefined: return object[name] = walk(right)
        case '=':  return object[name] = walk(right)
        case '+=': return object[name] += walk(right)
        case '-=': return object[name] -= walk(right)
        case '++': return object[name]++
        case '--': return object[name]--
      }
    }

  }
function setValue ( object , left , right , operator ) { var name = null if ( left . type === 'Identifier' ) { name = left . name // handle parent context shadowing object = objectForKey ( object , name , primitives ) } else if ( left . type === 'MemberExpression' ) { if ( left . computed ) { name = walk ( left . property ) } else { name = left . property . name } object = walk ( left . object ) } // stop built in properties from being able to be changed if ( canSetProperty ( object , name , primitives ) ) { switch ( operator ) { case undefined : return object [ name ] = walk ( right ) case '=' : return object [ name ] = walk ( right ) case '+=' : return object [ name ] += walk ( right ) case '-=' : return object [ name ] -= walk ( right ) case '++' : return object [ name ] ++ case '--' : return object [ name ] -- } } }
set a value in the specified context if allowed
set a value in the specified context if allowed