Skip to content

Commit 003910d

Browse files
committed
ensure timer API is bound to global scope (window)
1 parent 389dc71 commit 003910d

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎src/Global.js‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
33

4+
const timer = {
5+
setTimeout : function (cb, duration) {
6+
return setTimeout(cb, duration);
7+
},
8+
clearTimeout : function(handle){
9+
return clearTimeout(handle);
10+
}
11+
};
12+
413
export default class Global {
514
static get location(){
615
return location;
@@ -15,8 +24,6 @@ export default class Global {
1524
return XMLHttpRequest;
1625
}
1726
static get timer(){
18-
return {
19-
setTimeout, clearTimeout
20-
};
27+
return timer;
2128
}
2229
};

0 commit comments

Comments
 (0)