X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2FProxy.js;h=2348b872b7b2323e9a358fc1c52fead695cf1ca7;hb=f6e73ea983b61b50a6152c98a9945725eb45edb2;hp=51a6e949fc8190c69154708a62ecfa696cf512f5;hpb=644eff8b76ca1a39ac2841d4f76a46a32042f071;p=dygraphs.git diff --git a/auto_tests/tests/Proxy.js b/auto_tests/tests/Proxy.js index 51a6e94..2348b87 100644 --- a/auto_tests/tests/Proxy.js +++ b/auto_tests/tests/Proxy.js @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Google, Inc. +// Copyright (c) 2011 Google, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -38,7 +38,7 @@ var Proxy = function(delegate) { function makeFunc(name) { return function() { this.log__(name, arguments); - this.delegate__[name].apply(this.delegate__, arguments); + return this.delegate__[name].apply(this.delegate__, arguments); } }; this[propname] = makeFunc(propname); @@ -72,3 +72,8 @@ Proxy.prototype.log__ = function(name, args) { this.calls__.push(call); }; +Proxy.reset = function(proxy) { + proxy.calls__ = []; +} + +export default Proxy;