trace(): better detection of window.console() so that there isn't a runtime error in a Node.js release build
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3f3f3cf9 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3f3f3cf9 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3f3f3cf9 Branch: refs/heads/spark Commit: 3f3f3cf9c27b577ccd94e0edb0426b64858e2c8f Parents: 618c5c2 Author: Josh Tynjala <[email protected]> Authored: Fri Feb 12 11:07:27 2016 -0800 Committer: Alex Harui <[email protected]> Committed: Tue Feb 23 21:44:20 2016 -0800 ---------------------------------------------------------------------- .../Core/src/main/flex/org/apache/flex/utils/Language.as | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3f3f3cf9/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Language.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Language.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Language.as index 6a26191..e3a318c 100644 --- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Language.as +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Language.as @@ -308,10 +308,9 @@ package org.apache.flex.utils if (theConsole === undefined) { - var windowConsole:* = window.console; - if (windowConsole !== undefined) + if(typeof window !== "undefined") { - theConsole = windowConsole; + theConsole = window.console; } }
