Skip to content

reset common window methods in .reset? #15

@lancejpollard

Description

@lancejpollard

should we add this here?

var setTimeout = window.setTimeout;
var setInterval = window.setInterval;
var onerror = undefined;
var onload = undefined;

exports.reset = function(){
  for (var i = 0, key; key = this.globals[i]; i++) window[key] = undefined;
  window.setTimeout = setTimeout;
  window.setInterval = setInterval;
  window.onerror = onerror;
  window.onload = onload;
};

if not here, where should we put this? didn't want to put it into analytics.js-integration-tester because sometimes you want to wait until multiple tests have run (at least for now). doesn't seem ideal to have to define this for each integration though, since we could just removing the .global property?

/cc @ianstormtaylor @yields

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions