Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(26)

Unified Diff: dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java

Issue 1620805: Fix this->window confusion in DevMode
Patch Set: Use instance Created 1 year, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dev/core/src/com/google/gwt/dev/shell/JavaScriptHost.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java
diff --git a/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java b/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java
index da8a029227f2db9c5f01c3712367e38ef563ceeb..9760f065983318463be7c88b864bf3ce3b02c9e3 100644
--- a/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java
+++ b/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java
@@ -255,6 +255,13 @@ public class RewriteJsniMethods extends ClassAdapter {
visitInsn(Opcodes.ACONST_NULL);
} else {
loadThis();
+ // Ensure the instance method is not invoked against null, otherwise
+ // JS's apply will turn it into the window object. See Issue 3069.
+ visitMethodInsn(
+ Opcodes.INVOKESTATIC,
+ "com/google/gwt/dev/shell/JavaScriptHost",
+ "checkNotNull",
+ "(Ljava/lang/Object;)Ljava/lang/Object;");
}
// Stack is at 2
« no previous file with comments | « dev/core/src/com/google/gwt/dev/shell/JavaScriptHost.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld revision f51cb906c4ad+