Closed
Description
This works fine:
var template = Handlebars.compile('{{foo}}');
template({ foo: 'bar' });
// 'bar'
This breaks:
Object.prototype[0xD834] = true;
var template = Handlebars.compile('{{foo}}');
template({ foo: 'bar' });
// throws error
This led to a very obscure bug in Istanbul: gotwarlost/istanbul#55
I haven’t looked into this yet, but it seems like the sort of bug that can be avoided by simply using hasOwnProperty
checks.
Update: It may have something to do with this line: https://github.com/wycats/handlebars.js/blob/6bf9c6fc134c87dc150e485ea018c4b3f108e6b0/lib/handlebars/compiler/compiler.js#L568 params
is an array, so it gets the 55348
property, which gets enumerated somewhere else, I guess.
Metadata
Metadata
Assignees
Labels
No labels