MCPcopy Create free account
hub / github.com/dynjs/dynjs / getThis

Method getThis

src/main/java/org/dynjs/ir/Interpreter.java:206–218  ·  view source on GitHub ↗
(Object ref)

Source from the content-addressed store, hash-verified

204
205 // FIXME: move to helper class
206 public static Object getThis(Object ref) {
207 Object thisValue = null;
208
209 // FIXME: We can probably remove this check for IRJSFunctions since we will not be using references
210 if (ref instanceof Reference) {
211 if (((Reference) ref).isPropertyReference()) {
212 thisValue = ((Reference) ref).getBase();
213 } else {
214 thisValue = ((EnvironmentRecord) ((Reference) ref).getBase()).implicitThisValue();
215 }
216 }
217 return thisValue;
218 }
219
220 // FIXME: This breaks for non-numeric uses if isSubtraction
221 private static Object add(ExecutionContext context, Object lhs, Object rhs) {

Callers 2

executeMethod · 0.95
extensionsSpec.jsFile · 0.45

Calls 3

isPropertyReferenceMethod · 0.80
implicitThisValueMethod · 0.65
getBaseMethod · 0.45

Tested by

no test coverage detected