Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing recursion issue with tests-core.js.

  • Loading branch information...
commit eff433781089c3f9690b6ffb657406db0d805488 1 parent 05cfa67
David Humphrey authored
Showing with 10 additions and 7 deletions.
  1. +10 −7 test/philip.html5.org/tests-core.js
17 test/philip.html5.org/tests-core.js
View
@@ -162,13 +162,16 @@ function _addTest(test)
// Force getContext('2d') to use the 'webgl-2d' context,
// since some tests get their own context vs. ctx.
- canvas.getContext = function(t) {
- if (t === '2d') {
- return this.getContext('webgl-2d');
- } else {
- return this.getContext(t);
- }
- };
+ canvas.getContext = (function() {
+ var oldGetContext = canvas.getContext;
+ return function(t) {
+ if (t === '2d') {
+ return this.getContext('webgl-2d');
+ } else {
+ return oldGetContext.call(this, t);
+ }
+ };
+ })();
test(canvas, ctx);
}
Please sign in to comment.
Something went wrong with that request. Please try again.