System.getProperty('os.name') does not throw exception in javax.script mode
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 09 Oct 2013 22:26:24 +0200
changeset 1362b37e6e49d9d6
parent 1361 1b333e5804f5
child 1363 63714859ea5d
System.getProperty('os.name') does not throw exception in javax.script mode
rt/emul/compact/src/main/java/java/lang/System.java
     1.1 --- a/rt/emul/compact/src/main/java/java/lang/System.java	Wed Oct 09 22:04:11 2013 +0200
     1.2 +++ b/rt/emul/compact/src/main/java/java/lang/System.java	Wed Oct 09 22:26:24 2013 +0200
     1.3 @@ -50,7 +50,7 @@
     1.4          return null;
     1.5      }
     1.6      
     1.7 -    @JavaScriptBody(args = {}, body = "return navigator.userAgent;")
     1.8 +    @JavaScriptBody(args = {}, body = "return (typeof navigator !== 'undefined') ? navigator.userAgent : 'unknown';")
     1.9      private static native String userAgent();
    1.10      
    1.11      public static String getProperty(String key, String def) {