Also, for consistency with other APIs, mp.utils.{write,append}_file now return true on success (and still throw on any error).
Showing the changes to player/javascript/defaults.js (1 of 3 files). Show all
Unified · Split
| @@ -665,6 +665,8 @@ mp.get_time = function() { return mp.get_time_ms() / 1000 }; · 664 unmodified lines | |||
| 665 | mp.utils.getcwd = function() { return mp.get_property("working-directory") }; | 665 | mp.utils.getcwd = function() { return mp.get_property("working-directory") }; |
| 666 | mp.utils.getpid = function() { return mp.get_property_number("pid") } | 666 | mp.utils.getpid = function() { return mp.get_property_number("pid") } |
| 667 | mp.get_mouse_pos = function() { return mp.get_property_native("mouse-pos") }; | 667 | mp.get_mouse_pos = function() { return mp.get_property_native("mouse-pos") }; |
| 668 | mp.utils.write_file = mp.utils._write_file.bind(null, false); | ||
| 669 | mp.utils.append_file = mp.utils._write_file.bind(null, true); | ||
| 668 | mp.dispatch_event = dispatch_event; | 670 | mp.dispatch_event = dispatch_event; |
| 669 | mp.process_timers = process_timers; | 671 | mp.process_timers = process_timers; |
| 670 | mp.notify_idle_observers = notify_idle_observers; | 672 | mp.notify_idle_observers = notify_idle_observers; |