Replacing a for-in loop by an index loop on an array, to avoid enumerating inherited properties

This commit is contained in:
Sylvain Corlay 2014-01-11 19:46:07 +00:00
parent c0f346c4e3
commit a053ba2419

View File

@ -313,9 +313,9 @@ var IPython = (function (IPython) {
for( var mode in modes) {
var regs = modes[mode]['reg'];
// only one key every time but regexp can't be keys...
for(var reg in regs ) {
for(var i=0; i<regs.length; i++) {
// here we handle non magic_modes
if(first_line.match(regs[reg]) != null) {
if(first_line.match(regs[i]) != null) {
if(current_mode == mode){
return;
}