Do not consult prototype when getting a JS property via Scritable.get().
This isn't necessary anymore since property and child object getters have been separated, and we're no more risking to trigger a db select with the get.
This commit is contained in:
parent
bb0bc89fee
commit
c17acaf3a8
1 changed files with 0 additions and 18 deletions
|
@ -749,20 +749,6 @@ public class HopObject extends ScriptableObject implements Wrapper {
|
||||||
if (node == null) {
|
if (node == null) {
|
||||||
return super.get(name, start);
|
return super.get(name, start);
|
||||||
} else {
|
} else {
|
||||||
// Note: we do not normally consult the prototype in get(),
|
|
||||||
// but we do so here because calling get on the Node may trigger
|
|
||||||
// db select statements (resulting in errors) and getting a
|
|
||||||
// property on the parent prototype is much cheaper and safer.
|
|
||||||
// NOTE: because of this, prototype inheritance is reversed for HopObjects!
|
|
||||||
Scriptable prototype = getPrototype();
|
|
||||||
|
|
||||||
while (prototype != null) {
|
|
||||||
retval = prototype.get(name, this);
|
|
||||||
if (retval != NOT_FOUND) {
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
prototype = prototype.getPrototype();
|
|
||||||
}
|
|
||||||
return getFromNode(name);
|
return getFromNode(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -808,10 +794,6 @@ public class HopObject extends ScriptableObject implements Wrapper {
|
||||||
Object[] args = { new Long(d.getTime()) };
|
Object[] args = { new Long(d.getTime()) };
|
||||||
try {
|
try {
|
||||||
return cx.newObject(core.global, "Date", args);
|
return cx.newObject(core.global, "Date", args);
|
||||||
/* } catch (PropertyException px) {
|
|
||||||
return NOT_FOUND; */
|
|
||||||
/* } catch (NotAFunctionException nafx) {
|
|
||||||
return NOT_FOUND; */
|
|
||||||
} catch (JavaScriptException nafx) {
|
} catch (JavaScriptException nafx) {
|
||||||
return NOT_FOUND;
|
return NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue