mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix IE8 minification bug
The minifier changed the two uses of HTMLTag into two different symbols:
var n = function r() {
var t = this instanceof e.Tag ? this : new r(), n = 0, o = arguments.length && arguments[0];
return o && "object" == typeof o && o.constructor === Object && (t.attrs = o, n++),
n < arguments.length && (t.children = Array.prototype.slice.call(arguments, n)),
t;
};
return n.prototype = new e.Tag(), n.prototype.constructor = n, n.prototype.tagName = t,
n;
Then, IE8 apparently actually creates two separate objects for 'n' and
'r'; see #3 at http://kiro.me/blog/nfe_dilemma.html
So just because n.prototype is an e.Tag doesn't make r.prototype a e.Tag
This means that `new r() instanceof e.Tag` is false, and so the first
line of the function leads to infinite recursion.
I'm not sure if this is an uglify bug as well; dealing well with
multiple declarations of the same function may be out of spec.
Fixes #2037.
This commit is contained in:
@@ -31,7 +31,7 @@ HTML.ensureTag = function (tagName) {
|
||||
// Given "p" create the function `HTML.P`.
|
||||
var makeTagConstructor = function (tagName) {
|
||||
// HTMLTag is the per-tagName constructor of a HTML.Tag subclass
|
||||
var HTMLTag = function HTMLTag(/*arguments*/) {
|
||||
var HTMLTag = function (/*arguments*/) {
|
||||
// Work with or without `new`. If not called with `new`,
|
||||
// perform instantiation by recursively calling this constructor.
|
||||
// We can't pass varargs, so pass no args.
|
||||
|
||||
Reference in New Issue
Block a user