rename Ox.break to Ox.Break and move it to Core.js, use storage['delete'] in order to support older IE versions

This commit is contained in:
rlx 2012-05-24 17:10:29 +00:00
parent c8c50b9e89
commit c4e66fbb3d

View file

@ -83,6 +83,15 @@ Some conventions:
}; };
})(this); })(this);
/*@
Ox.Break <f> Breaks from <code>Ox.forEach</code> and <code>Ox.loop</code>
@*/
Ox.Break = function() {
throw Ox.BreakError;
};
Ox.BreakError = new SyntaxError('Illegal Ox.break() statement');
/*@ /*@
Ox.load <f> Loads a module Ox.load <f> Loads a module
A module named "Foo" provides <code>Ox.Foo/Ox.Foo.js</code>, in which it A module named "Foo" provides <code>Ox.Foo/Ox.Foo.js</code>, in which it
@ -157,7 +166,8 @@ Ox.localStorage = function(namespace) {
} }
return ret; return ret;
}; };
storage.delete = function(key) { // IE 8 doesn't like `storage.delete`
storage['delete'] = function(key) {
var keys = arguments.length == 0 var keys = arguments.length == 0
? Object.keys(storage()) ? Object.keys(storage())
: [key]; : [key];