Index: dev/windows/src/com/google/gwt/dev/shell/ie/JsValueIE6.java
===================================================================
--- dev/windows/src/com/google/gwt/dev/shell/ie/JsValueIE6.java (revision 679)
+++ dev/windows/src/com/google/gwt/dev/shell/ie/JsValueIE6.java (working copy)
@@ -117,7 +117,17 @@
* @see com.google.gwt.dev.shell.JsValue#getString()
*/
public String getString() {
- return variant.getString();
+ // TODO(jat): gross hack for IE7 support: IE7 appears to return an
+ // object of type 130, which is not documented anywhere, from the name
+ // field of a JavaScript exception. We special-case this type to allow
+ // return a marker string instead of failing. We need to figure out the
+ // proper way to get the name for IE7, but for now this hack keeps tests
+ // from failing.
+ if (variant.getType() == 130) {
+ return "IE7 Exception Name";
+ } else {
+ return variant.getString();
+ }
}
/*
@@ -260,8 +270,14 @@
if (variant.getType() == COM.VT_BSTR) {
return true;
}
- if (variant.getType() != COM.VT_DISPATCH) {
- return false;
+ // TODO(jat): gross hack for IE7 support: IE7 appears to return an
+ // object of type 130, which is not documented anywhere, from the name
+ // field of a JavaScript exception. We special-case this type to allow
+ // return a marker string instead of failing. We need to figure out the
+ // proper way to get the name for IE7, but for now this hack keeps tests
+ // from failing.
+ if (variant.getType() == 130) {
+ return true;
}
// see if it's a String wrapper object
I'm torn. I think patching it to stop unit tests failing is a pretty risky practice since the failure is telling us something important. In particular, since we don't understand exactly what's happening, we can't say for sure that it won't happen elsewhere.
I would rather spend another day aggressively trying to figure this out than to hack it. Did you try getting the latest Microsoft Platform SDK? Surely it's in the headers somewhere. Maybe online MSDN is just old and doesn't explain the VARENUM. Maybe the source itself would explain.
What happens when you try to use the Variant class to coerce type 130
into a String? Is there no way to get the actual name out? I thought
you said the correct type name (e.g. "Type Error") appeared in the
debugger.
What happened to these lines?
if (variant.getType() != COM.VT_DISPATCH) {
return false;
}
Shouldn't they still be in there after the 130 hack?
Scott
On 3/22/07, John Tamplin <j...@google.com> wrote:
What happens when you try to use the Variant class to coerce type 130
into a String? Is there no way to get the actual name out? I thought
you said the correct type name (e.g. "Type Error") appeared in the
debugger.
What happened to these lines?
if (variant.getType() != COM.VT_DISPATCH) {
return false;
}
Shouldn't they still be in there after the 130 hack?
I'm just saying, returning "IE7 Exception Name" is about the least
useful thing we can do, I'm sure you can find a good solution to doing
something better. :)
> > What happened to these lines?
> > if (variant.getType() != COM.VT_DISPATCH) {
> > return false;
> > }
> > Shouldn't they still be in there after the 130 hack?
> >
>
> I will check when I get in (I can't get into my Windows VMware instance from
> home), but yes the handling of String should not have been changed. It was
> probably removed by accident hand-editing the diff file to remove the
> still-pending change to factor out the code for handling String objects
> since I didn't want to mix that change in with this one for review.
That's bitten you before, I think. FYI, here's my workflow, when I
have multiple changes that may conflict:
I'll make a patch file for my first change set (in the root of the
trunk). Then I'll revert those changed files, get my working copy
back into clean state, and begin working on the other change set.
That will become its own patch file. So generally I won't keep two
change sets active in the same client unless they clearly don't
conflict.
Of course, TortoiseSVN makes all this much easier, because it's got
UI-driven patch/apply patch that makes it easy to select a set of
files.
Scott
I'm just saying, returning "IE7 Exception Name" is about the least
useful thing we can do, I'm sure you can find a good solution to doing
something better. :)
Of course, TortoiseSVN makes all this much easier, because it's got
UI-driven patch/apply patch that makes it easy to select a set of
files.
Sure, but this is where the law of useful partials comes into play.
Each change should be independently useful.. if they aren't, then it's
really just one change, right?
Scott
I'm torn. I think patching it to stop unit tests failing is a pretty risky practice since the failure is telling us something important. In particular, since we don't understand exactly what's happening, we can't say for sure that it won't happen elsewhere.
I would rather spend another day aggressively trying to figure this out than to hack it. Did you try getting the latest Microsoft Platform SDK? Surely it's in the headers somewhere. Maybe online MSDN is just old and doesn't explain the VARENUM. Maybe the source itself would explain.
In Variant:
- You should use tabs instead of spaces in this file. Yes, this is
annoying, but it's how the rest of the file is formatted.
- You should mark the file with a "// Modfied by Google" comment in
the header, and mark all our mods with "GOOGLE:" comments. See
OleAutomation or Library for examples.
- You might consider refactoring the 130 out into a constant, which
you can give a descriptive name and put the main commenting on.
- You should also send a note to Steve Northover
<Steve_N...@ca.ibm.com> letting him know what we encountered and
how we're working around it. Please cc me on the thread.
Scott
On 3/23/07, John Tamplin <j...@google.com> wrote:
In JsValueIE6:
It seems weird to return VT_UNKNOWN from getDispatchValueOf()... it
seems cleaner to assert (variant.getType() == VT_DISPATCH) inside of
the method, and guard outside of the method.
In Variant:
- You should use tabs instead of spaces in this file. Yes, this is
annoying, but it's how the rest of the file is formatted.
- You should mark the file with a "// Modfied by Google" comment in
the header, and mark all our mods with "GOOGLE:" comments. See
OleAutomation or Library for examples.
- You might consider refactoring the 130 out into a constant, which
you can give a descriptive name and put the main commenting on.
- You should also send a note to Steve Northover
< Steve_N...@ca.ibm.com> letting him know what we encountered and
how we're working around it. Please cc me on the thread.