- Timestamp:
- 2019-08-04T21:29:37+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
r14455 r15277 13 13 import javax.script.ScriptEngine; 14 14 import javax.script.ScriptException; 15 import javax.swing.JOptionPane; 15 16 16 17 import org.openstreetmap.josm.command.ChangePropertyCommand; … … 19 20 import org.openstreetmap.josm.data.validation.Test; 20 21 import org.openstreetmap.josm.data.validation.TestError; 22 import org.openstreetmap.josm.gui.Notification; 21 23 import org.openstreetmap.josm.io.CachedFile; 22 24 import org.openstreetmap.josm.tools.LanguageInfo; … … 52 54 try (CachedFile cf = new CachedFile("resource://data/validator/opening_hours.js"); 53 55 Reader reader = cf.getContentReader()) { 56 ENGINE.eval( 57 "var global=this;var window=this;var process={env:{}};" + 58 "var console={};console.debug=print;console.log=print;console.warn=print;console.error=print;"); 54 59 ENGINE.eval(reader); 55 60 ENGINE.eval("var opening_hours = require('opening_hours');"); … … 247 252 } catch (ScriptException | NoSuchMethodException ex) { 248 253 Logging.error(ex); 254 new Notification(Utils.getRootCause(ex).getMessage()).setIcon(JOptionPane.ERROR_MESSAGE).show(); 249 255 } 250 256 return errors;
Note:
See TracChangeset
for help on using the changeset viewer.