| 40 | } |
| 41 | |
| 42 | public Object getValue(ExecutionContext context) { |
| 43 | // 8.7.1 |
| 44 | Object value = null; |
| 45 | if (isUnresolvableReference()) { |
| 46 | throw new ThrowException(context, context.createReferenceError(referencedName + " is not defined")); |
| 47 | } |
| 48 | |
| 49 | if (isPropertyReference()) { |
| 50 | if (!hasPrimitiveBase()) { |
| 51 | value = ((JSObject) this.base).get(context, this.referencedName); |
| 52 | } else { |
| 53 | value = primitiveGet(context, Types.toObject(context, this.base), this.referencedName); |
| 54 | } |
| 55 | } else { |
| 56 | value = ((EnvironmentRecord) this.base).getBindingValue(context, this.referencedName, this.strict); |
| 57 | } |
| 58 | |
| 59 | return value; |
| 60 | } |
| 61 | |
| 62 | protected Object primitiveGet(ExecutionContext context, JSObject o, String name) { |
| 63 | // 8.7.1 primitive [[Get]] |