Jforrester has uploaded a new change for review.
https://gerrit.wikimedia.org/r/124360
Change subject: core: Avoid an IE8 bug causing a fatal error when loaded on
that platform
......................................................................
core: Avoid an IE8 bug causing a fatal error when loaded on that platform
Change-Id: I2e84dc592b3d6adb5d17989380523e007d2ada05
---
M src/Factory.js
M src/core.js
M test/oo.core.test.js
3 files changed, 7 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/core refs/changes/60/124360/1
diff --git a/src/Factory.js b/src/Factory.js
index 4bef765..0c72a68 100644
--- a/src/Factory.js
+++ b/src/Factory.js
@@ -5,7 +5,8 @@
* @constructor
*/
oo.Factory = function OoFactory() {
- oo.Factory.super.call( this );
+ // Using ['super'] rather than .super to avoid fatal errors in MSIE8
+ oo.Factory['super'].call( this );
// Properties
this.entries = [];
@@ -45,7 +46,8 @@
}
this.entries.push( name );
- oo.Factory.super.prototype.register.call( this, name, constructor );
+ // Using ['super'] rather than .super to avoid fatal errors in MSIE8
+ oo.Factory['super'].prototype.register.call( this, name, constructor );
};
/**
diff --git a/src/core.js b/src/core.js
index 3868e4f..f9eb2a0 100644
--- a/src/core.js
+++ b/src/core.js
@@ -93,7 +93,7 @@
var targetConstructor = targetFn.prototype.constructor;
- targetFn.super = originFn;
+ targetFn['super'] = originFn;
targetFn.prototype = Object.create( originFn.prototype, {
// Restore constructor property of targetFn
constructor: {
diff --git a/test/oo.core.test.js b/test/oo.core.test.js
index 933df53..f9021ef 100644
--- a/test/oo.core.test.js
+++ b/test/oo.core.test.js
@@ -860,7 +860,7 @@
assert.deepEqual(
oo.simpleArrayIntersection(
[ 'a', 'b', 'c', 'a' ],
- [, 'b', 'c', 'd', 'c' ]
+ [ 'b', 'c', 'd', 'c' ]
),
[ 'b', 'c' ],
'Simple'
@@ -879,7 +879,7 @@
assert.deepEqual(
oo.simpleArrayDifference(
[ 'a', 'b', 'c', 'a' ],
- [, 'b', 'c', 'd', 'c' ]
+ [ 'b', 'c', 'd', 'c' ]
),
[ 'a', 'a' ],
'Simple'
--
To view, visit https://gerrit.wikimedia.org/r/124360
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e84dc592b3d6adb5d17989380523e007d2ada05
Gerrit-PatchSet: 1
Gerrit-Project: oojs/core
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits