aboutsummaryrefslogtreecommitdiff
path: root/src/jdk/nashorn/internal/runtime/FindProperty.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jdk/nashorn/internal/runtime/FindProperty.java')
-rw-r--r--src/jdk/nashorn/internal/runtime/FindProperty.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/jdk/nashorn/internal/runtime/FindProperty.java b/src/jdk/nashorn/internal/runtime/FindProperty.java
index 35ffed93..903d1d5d 100644
--- a/src/jdk/nashorn/internal/runtime/FindProperty.java
+++ b/src/jdk/nashorn/internal/runtime/FindProperty.java
@@ -105,6 +105,22 @@ public final class FindProperty {
}
/**
+ * Return the appropriate receiver for a getter.
+ * @return appropriate receiver
+ */
+ public ScriptObject getGetterReceiver() {
+ return property != null && property.hasGetterFunction() ? self : prototype;
+ }
+
+ /**
+ * Return the appropriate receiver for a setter.
+ * @return appropriate receiver
+ */
+ public ScriptObject getSetterReceiver() {
+ return property != null && property.hasSetterFunction() ? self : prototype;
+ }
+
+ /**
* Return the property that was found
* @return property
*/