Java 类jdk.nashorn.internal.runtime.UserAccessorProperty 实例源码

项目:kaziranga    文件:PrimitiveLookup.java   
@SuppressWarnings("unused")
private static void primitiveSetter(final ScriptObject wrappedSelf, final Object self, final Object key,
                                    final boolean strict, final Object value) {
    // See ES5.1 8.7.2 PutValue (V, W)
    final String name = JSType.toString(key);
    final FindProperty find = wrappedSelf.findProperty(name, true);
    if (find == null || !(find.getProperty() instanceof UserAccessorProperty) || !find.getProperty().isWritable()) {
        if (strict) {
            throw typeError("property.not.writable", name, ScriptRuntime.safeToString(self));
        }
        return;
    }
    // property found and is a UserAccessorProperty
    find.setValue(value, strict);
}
项目:lookaside_java-1.8.0-openjdk    文件:PrimitiveLookup.java   
@SuppressWarnings("unused")
private static void primitiveSetter(final ScriptObject wrappedSelf, final Object self, final Object key,
                                    final boolean strict, final Object value) {
    // See ES5.1 8.7.2 PutValue (V, W)
    final String name = JSType.toString(key);
    final FindProperty find = wrappedSelf.findProperty(name, true);
    if (find == null || !(find.getProperty() instanceof UserAccessorProperty) || !find.getProperty().isWritable()) {
        if (strict) {
            throw typeError("property.not.writable", name, ScriptRuntime.safeToString(self));
        }
        return;
    }
    // property found and is a UserAccessorProperty
    find.setValue(value, strict);
}
项目:jdk8u_nashorn    文件:PrimitiveLookup.java   
@SuppressWarnings("unused")
private static void primitiveSetter(final ScriptObject wrappedSelf, final Object self, final Object key,
                                    final boolean strict, final Object value) {
    // See ES5.1 8.7.2 PutValue (V, W)
    final String name = JSType.toString(key);
    final FindProperty find = wrappedSelf.findProperty(name, true);
    if (find == null || !(find.getProperty() instanceof UserAccessorProperty) || !find.getProperty().isWritable()) {
        if (strict) {
            throw typeError("property.not.writable", name, ScriptRuntime.safeToString(self));
        }
        return;
    }
    // property found and is a UserAccessorProperty
    find.setValue(value, strict);
}