File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,17 @@ bot.inject.unwrapValue = function(value, opt_doc) {
183
183
*/
184
184
bot . inject . recompileFunction_ = function ( fn , theWindow ) {
185
185
if ( goog . isString ( fn ) ) {
186
- return new theWindow [ 'Function' ] ( fn ) ;
186
+ try {
187
+ return new theWindow [ 'Function' ] ( fn ) ;
188
+ } catch ( ex ) {
189
+ // Try to recover if in IE5-quirks mode
190
+ // Need to initialize the script engine on the passed-in window
191
+ if ( goog . userAgent . IE && theWindow . execScript ) {
192
+ theWindow . execScript ( ';' ) ;
193
+ return new theWindow [ 'Function' ] ( fn ) ;
194
+ }
195
+ throw ex ;
196
+ }
187
197
}
188
198
return theWindow == window ? fn : new theWindow [ 'Function' ] (
189
199
'return (' + fn + ').apply(null,arguments);' ) ;
@@ -376,7 +386,7 @@ bot.inject.wrapError = function(err) {
376
386
err [ 'code' ] : bot . ErrorCode . UNKNOWN_ERROR ,
377
387
// TODO: Parse stackTrace
378
388
'value' : {
379
- 'message' : err . message
389
+ 'message' : err . message + '\n' + ( err . stack || '' )
380
390
}
381
391
} ;
382
392
} ;
You can’t perform that action at this time.
0 commit comments