Fix for in without hasOwnProperty

This commit is contained in:
Luke Page
2014-01-10 20:09:36 +00:00
parent 0af345e086
commit 6dfb00751c
8 changed files with 44 additions and 30 deletions

View File

@@ -23,14 +23,17 @@ tree.JavaScript.prototype = {
index: this.index };
}
for (var k in env.frames[0].variables()) {
/*jshint loopfunc:true */
context[k.slice(1)] = {
value: env.frames[0].variables()[k].value,
toJS: function () {
return this.value.eval(env).toCSS();
}
};
var variables = env.frames[0].variables();
for (var k in variables) {
if (variables.hasOwnProperty(k)) {
/*jshint loopfunc:true */
context[k.slice(1)] = {
value: variables[k].value,
toJS: function () {
return this.value.eval(env).toCSS();
}
};
}
}
try {