예제 #1
0
파일: Reference.java 프로젝트: XiaoSK/dynjs
 public void putValue(ExecutionContext context, Object value) {
   // 8.7.2
   if (isUnresolvableReference()) {
     if (isStrictReference()) {
       throw new ThrowException(
           context, context.createReferenceError(referencedName + " is not defined"));
     } else {
       context.getGlobalContext().getObject().put(context, this.referencedName, value, false);
     }
   } else if (isPropertyReference()) {
     if (!hasPrimitiveBase()) {
       ((JSObject) this.base).put(context, this.referencedName, value, this.strict);
     } else {
       // TODO: handle primitives
     }
   } else {
     ((EnvironmentRecord) this.base)
         .setMutableBinding(context, this.referencedName, value, this.strict);
   }
 }