From c4e66fbb3d862e5ee9f1a744a8ba939bb0bda9a8 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 24 May 2012 17:10:29 +0000 Subject: [PATCH] rename Ox.break to Ox.Break and move it to Core.js, use storage['delete'] in order to support older IE versions --- source/Ox/js/Core.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/Ox/js/Core.js b/source/Ox/js/Core.js index a05539e0..496afc96 100644 --- a/source/Ox/js/Core.js +++ b/source/Ox/js/Core.js @@ -83,6 +83,15 @@ Some conventions: }; })(this); +/*@ +Ox.Break Breaks from Ox.forEach and Ox.loop +@*/ +Ox.Break = function() { + throw Ox.BreakError; +}; + +Ox.BreakError = new SyntaxError('Illegal Ox.break() statement'); + /*@ Ox.load Loads a module A module named "Foo" provides Ox.Foo/Ox.Foo.js, in which it @@ -157,7 +166,8 @@ Ox.localStorage = function(namespace) { } return ret; }; - storage.delete = function(key) { + // IE 8 doesn't like `storage.delete` + storage['delete'] = function(key) { var keys = arguments.length == 0 ? Object.keys(storage()) : [key];