OLD | NEW |
(Empty) | |
| 1 /** |
| 2 * @fileOverview A platform-specific primitive set for the module action.js. Thi
s is targeted at the js-test-driver, |
| 3 * which uses the browser. |
| 4 */ |
| 5 |
| 6 /** |
| 7 * @namespace |
| 8 */ |
| 9 Action_Platform = {}; |
| 10 |
| 11 Action_Platform.dispatch = function( f ) |
| 12 { |
| 13 return setTimeout( f, 0 ); |
| 14 }; |
| 15 |
| 16 Action_Platform.set_timer = function( f, duration ) |
| 17 { |
| 18 return setTimeout( f, duration ) |
| 19 }; |
| 20 |
| 21 Action_Platform.clear_timer = function( id ) |
| 22 { |
| 23 clearTimeout( id ); |
| 24 }; |
| 25 |
| 26 /** |
| 27 * The file "action.js" is targeted for the ABP bootstrapped extension environme
nt. We need an implementation of |
| 28 * require() to make it work. |
| 29 * |
| 30 * @param module_name |
| 31 * @return {{Action_Platform: *}} |
| 32 */ |
| 33 function require( module_name ) |
| 34 { |
| 35 switch ( module_name ) |
| 36 { |
| 37 case "action_platform": |
| 38 return { Action_Platform: Action_Platform }; |
| 39 default: |
| 40 throw new Error( "Module name not recognized." ); |
| 41 } |
| 42 } |
OLD | NEW |