protected final void defaultPut(String name, Object value) { super.put(name, this, value); }
/** * {@inheritDoc} */ @Override public void setScriptObject(final Object scriptObject) { final ScriptableObject so = (ScriptableObject) scriptObject; if (so != null) { so.put("dialogArguments", so, arguments_); } super.setScriptObject(scriptObject); }
/** * {@inheritDoc} */ @Override public void setScriptObject(final Object scriptObject) { final ScriptableObject so = (ScriptableObject) scriptObject; if (so != null) { so.put("dialogArguments", so, arguments_); } super.setScriptObject(scriptObject); }
@Override public void put(String name, Scriptable start, Object value) { if (this == thePrototypeInstance) super.put(name, start, value); else System.getProperties().put(name, ScriptRuntime.toString(value)); }
/** * {@inheritDoc} */ @Override public <T> void setScriptableObject(final T scriptObject) { if (scriptObject instanceof ScriptableObject) { ((ScriptableObject) scriptObject).put("dialogArguments", (ScriptableObject) scriptObject, arguments_); } super.setScriptableObject(scriptObject); }
/** * {@inheritDoc} */ @Override public <T> void setScriptableObject(final T scriptObject) { if (scriptObject instanceof ScriptableObject) { ((ScriptableObject) scriptObject).put("dialogArguments", (ScriptableObject) scriptObject, arguments_); } super.setScriptableObject(scriptObject); }
/** * {@inheritDoc} */ @Override public void setScriptObject(final Object scriptObject) { final ScriptableObject so = (ScriptableObject) scriptObject; if (so != null) { so.put("dialogArguments", so, arguments_); } super.setScriptObject(scriptObject); }
/** * Sets a named member of a JavaScript object. * Equivalent to "this.name = value" in JavaScript. * * @param name the name of the JavaScript property to be accessed * @param value the value of the property * @throws JSException in case or error */ public void setMember(final String name, final Object value) throws JSException { String stringValue = ""; if (value != null) { stringValue = Context.toString(value); } if (LOG.isInfoEnabled()) { LOG.info("JSObject setMember '" + name + "' to '" + stringValue + "'"); } if (scriptableObject_ instanceof Element) { ((Element) scriptableObject_).setAttribute(name, stringValue); return; } scriptableObject_.put(name, scriptableObject_, value); }
/** * {@inheritDoc} */ @Override public void put(final String name, final Scriptable start, final Object value) { try { super.put(name, start, value); } catch (final IllegalArgumentException e) { // is it the right place or should Rhino throw a RuntimeError instead of an IllegalArgumentException? throw Context.reportRuntimeError("'set " + name + "' called on an object that does not implement interface " + getClassName()); } } }
/** * {@inheritDoc} */ @Override public void put(final String name, final Scriptable start, final Object value) { try { super.put(name, start, value); } catch (final IllegalArgumentException e) { // is it the right place or should Rhino throw a RuntimeError instead of an IllegalArgumentException? throw Context.reportRuntimeError("'set " + name + "' called on an object that does not implement interface " + getClassName()); } } }
/** * Sets a named member of a JavaScript object. * Equivalent to "this.name = value" in JavaScript. * * @param name the name of the JavaScript property to be accessed * @param value the value of the property * @throws JSException in case or error */ public void setMember(final String name, final Object value) throws JSException { String stringValue = ""; if (value != null) { stringValue = Context.toString(value); } if (LOG.isInfoEnabled()) { LOG.info("JSObject setMember '" + name + "' to '" + stringValue + "'"); } if (scriptableObject_ instanceof Element) { ((Element) scriptableObject_).setAttribute(name, stringValue); return; } scriptableObject_.put(name, scriptableObject_, value); }
/** * Define a JavaScript property. * * Creates the property with an initial value and sets its attributes. * * @param propertyName the name of the property to define. * @param value the initial value of the property * @param attributes the attributes of the JavaScript property * @see net.sourceforge.htmlunit.corejs.javascript.Scriptable#put(String, Scriptable, Object) */ public void defineProperty(String propertyName, Object value, int attributes) { checkNotSealed(propertyName, 0); put(propertyName, this, value); setAttributes(propertyName, attributes); }
NativeJavaPackage forcePackage(String name, Scriptable scope) { Object cached = super.get(name, this); if (cached != null && cached instanceof NativeJavaPackage) { return (NativeJavaPackage) cached; } else { String newPackage = packageName.length() == 0 ? name : packageName + "." + name; NativeJavaPackage pkg = new NativeJavaPackage(true, newPackage, classLoader); ScriptRuntime.setObjectProtoAndParent(pkg, scope); super.put(name, this, pkg); return pkg; } }
super.put(name, start, newValue);
super.put(name, start, value);
ScriptableObject desc = obj.getOwnPropertyDescriptor(cx, name); if (Boolean.TRUE.equals(desc.get("configurable"))) { desc.put("configurable", desc, false); obj.defineOwnProperty(cx, name, desc); ScriptableObject desc = obj.getOwnPropertyDescriptor(cx, name); if (isDataDescriptor(desc) && Boolean.TRUE.equals(desc.get("writable"))) desc.put("writable", desc, false); if (Boolean.TRUE.equals(desc.get("configurable"))) desc.put("configurable", desc, false); obj.defineOwnProperty(cx, name, desc);