From 455199a482eda82cdc3f57f960268ca149c073e9 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Thu, 3 May 2012 14:25:02 -0700 Subject: [PATCH] Range check node attributes. Fixes #64 --- enyo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enyo.js b/enyo.js index eaacfc238..ff9ab6d88 100644 --- a/enyo.js +++ b/enyo.js @@ -24,7 +24,7 @@ // infer the framework path from the document, unless the user has specified one explicitly enyo.args.root = (enyo.args.root || tag.path); /*.replace("/source", "")*/; // all attributes of the bootstrap script tag become enyo.args - for (var i=0, it; (it = tag.node.attributes.item(i)); i++) { + for (var i=0, al = tag.node.attributes.length, it; (i < al) && (it = tag.node.attributes.item(i)); i++) { enyo.args[it.nodeName] = it.value; } } @@ -38,4 +38,4 @@ script("../../loader.js"); script("boot.js"); script("../package.js"); -})(); \ No newline at end of file +})();