Skip to content

Commit

Permalink
Load old versions from unpkg for perf tests to simplify future releases
Browse files Browse the repository at this point in the history
  • Loading branch information
slevithan committed Nov 18, 2020
1 parent d60ff52 commit 760ab95
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 63,709 deletions.
30 changes: 9 additions & 21 deletions tests/perf/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,16 @@
(function() {
var match = /[?&]version=([^&]+)/.exec(location.search);
var version = match ? match[1] : null;
var knownVersion = {
'4.4.0': true,
'4.3.1': true,
'4.2.4': true,
'4.2.3': true,
'4.2.0': true,
'4.1.1': true,
'4.0.0': true,
'3.2.0': true,
'3.1.1': true,
'3.1.0': true,
'3.0.0': true,
'2.0.0': true,
'1.5.1': true
};
var isValidVersion = /^\d+\.\d+\.\d+(?:-\w+)?$/.test(version);

if (version === null || version === 'latest') {
document.write('<script src="../../xregexp-all.js"><\/script>');
} else if (knownVersion[version]) {
} else if (isValidVersion) {
// Hack around ES6 incompatibility in XRegExp versions prior to 3.0.0
if (parseInt(version, 10) < 3) {
delete RegExp.prototype.sticky;
}
document.write('<script src="versions/xregexp-all-v'+version+'.js"><\/script>');
} else {
document.getElementById('log').innerHTML = 'Unrecognized version provided in query';
document.write('<script src="https://unpkg.com/xregexp@' + version + '/xregexp-all.js"><\/script>');
}
}());
</script>
Expand Down Expand Up @@ -77,8 +61,12 @@
}
}());

// Global run function provided by perf script
onload = run;
if (typeof XRegExp === 'undefined') {
document.getElementById('log').innerHTML = 'Unable to find XRegExp version provided in query at &lt;unpkg.com&gt;';
} else {
// Global run function provided by perf script
onload = run;
}
</script>
</body>
</html>
1,297 changes: 0 additions & 1,297 deletions tests/perf/versions/xregexp-all-v1.5.1.js

This file was deleted.

0 comments on commit 760ab95

Please sign in to comment.