The patch explicitly check if "this" is null, when invoking a static method and throw a
JavaScriptException in this case.
Patch by: amitmanjhi
Review by: rjrjr
git-svn-id: https://google-web-toolkit.googlecode.com/svn/branches/farewellSwt@6230 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/oophm/src/com/google/gwt/dev/shell/MethodDispatch.java b/dev/oophm/src/com/google/gwt/dev/shell/MethodDispatch.java
index 4e2b327..8f1c062 100644
--- a/dev/oophm/src/com/google/gwt/dev/shell/MethodDispatch.java
+++ b/dev/oophm/src/com/google/gwt/dev/shell/MethodDispatch.java
@@ -56,6 +56,10 @@
if (method.needsThis()) {
jthis = JsValueGlue.get(jsthis, classLoader, method.getDeclaringClass(),
"invoke this");
+ if (jthis == null) {
+ throw ModuleSpace.createJavaScriptException(classLoader,
+ "Invoking an instance method on a null instance");
+ }
}
for (int i = 0; i < argc; ++i) {
args[i] = JsValueGlue.get(jsargs[i], classLoader, paramTypes[i],