modified to allow global variables for js3-mode.