Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adufilie committed Aug 4, 2014
1 parent 5d71f46 commit c37a58c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
18 changes: 3 additions & 15 deletions WeaveMobileClient/src/MobileConsole.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,9 @@
switch (String(name))
{
case 'exec': return JavaScript.exec as Function;
case 'call': return function(...args):*
{
var prev:Boolean = ExternalInterface.marshallExceptions;
try
{
ExternalInterface.marshallExceptions = true;
ExternalInterface.call.apply(this, args);
}
catch (e:*)
{
ExternalInterface.marshallExceptions = prev;
throw e;
}
// we can't put this in a finally{} block because it prevents catch() from happening if set to false.
ExternalInterface.marshallExceptions = prev;
case 'call': return function(...args):* {
ExternalInterface.marshallExceptions = true;
return ExternalInterface.call.apply(ExternalInterface, args);
};
case 'application': return FlexGlobals.topLevelApplication;
case 'print': return ObjectUtil.toString as Function;
Expand Down
20 changes: 3 additions & 17 deletions WeaveUI/src/weave/ui/Console.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,9 @@
private const symbolTable:Object = [{
'exec': JavaScript.exec,
'call': function(...args):*
{
var prev:Boolean = ExternalInterface.marshallExceptions;
var result:*;
try
{
ExternalInterface.marshallExceptions = true;
result = ExternalInterface.call.apply(this, args);
}
catch (e:Error)
{
ExternalInterface.marshallExceptions = prev;
throw e;
}
// we can't put this in a finally{} block because it prevents catch() from happening if set to false.
ExternalInterface.marshallExceptions = prev;
return result;
'call': function(...args):* {
ExternalInterface.marshallExceptions = true;
return ExternalInterface.call.apply(ExternalInterface, args);
},
'application': WeaveAPI.topLevelApplication,
'visApp': getVisApp(),
Expand Down

0 comments on commit c37a58c

Please sign in to comment.