src/jdk/nashorn/internal/objects/Global.java
Print this page
*** 1703,1715 ****
if (env._scripting) {
initScripting(env);
}
! if (Context.DEBUG && System.getSecurityManager() == null) {
initDebug();
}
copyBuiltins();
// initialized with strings so that typeof will work as expected.
this.__FILE__ = "";
--- 1703,1732 ----
if (env._scripting) {
initScripting(env);
}
! if (Context.DEBUG) {
! boolean debugOkay;
! final SecurityManager sm = System.getSecurityManager();
! if (sm != null) {
! try {
! sm.checkPermission(new RuntimePermission(Context.NASHORN_DEBUG_MODE));
! debugOkay = true;
! } catch (final SecurityException ignored) {
! // if no permission, don't initialize Debug object
! debugOkay = false;
! }
!
! } else {
! debugOkay = true;
! }
!
! if (debugOkay) {
initDebug();
}
+ }
copyBuiltins();
// initialized with strings so that typeof will work as expected.
this.__FILE__ = "";