mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Create harmony-proxy-tests.ts
Create harmony-proxy-global-test.ts Delete harmony-proxy-global-test.ts Update harmony-proxy.d.ts Update harmony-proxy-tests.ts Update harmony-proxy-tests.ts Update harmony-proxy-tests.ts Update harmony-proxy-tests.ts Update harmony-proxy-tests.ts
This commit is contained in:
committed by
remojansen
parent
2e0490d06c
commit
91265f7398
@@ -0,0 +1,27 @@
|
||||
/// <reference path="./harmony-proxy.d.ts" />
|
||||
|
||||
import * as Proxy from "harmony-proxy";
|
||||
|
||||
interface IKatana {
|
||||
use: () => void;
|
||||
}
|
||||
|
||||
class Katana implements IKatana {
|
||||
public use() {
|
||||
console.log("Used Katana!");
|
||||
}
|
||||
}
|
||||
|
||||
let handler = {
|
||||
apply: function(target: any, thisArg: any, argArray: any) {
|
||||
console.log(`Starting: ${performance.now()}`);
|
||||
let result = target.apply(thisArg, argArray);
|
||||
console.log(`Finished: ${performance.now()}`);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
let katana = new Katana();
|
||||
|
||||
let katanaProxy = new Proxy<IKatana>(katana, handler);
|
||||
katanaProxy.use();
|
||||
Vendored
-2
@@ -29,8 +29,6 @@ declare module harmonyProxy {
|
||||
}
|
||||
}
|
||||
|
||||
declare let Proxy: harmonyProxy.ProxyConstructor;
|
||||
|
||||
declare module "harmony-proxy" {
|
||||
let _Proxy: harmonyProxy.ProxyConstructor;
|
||||
export = _Proxy;
|
||||
|
||||
Reference in New Issue
Block a user