diff options
| author | Misko Hevery | 2010-10-20 23:17:59 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-10-20 23:17:59 -0700 |
| commit | 05d4971abb5b8e21c5d33a71771a961c7932206b (patch) | |
| tree | cb71f9876d97f34728bdcf33edaad6678cfed6e4 /src | |
| parent | c6107fe8acbc2c7631c728044bb57b608c3aeef1 (diff) | |
| download | angular.js-05d4971abb5b8e21c5d33a71771a961c7932206b.tar.bz2 | |
fix some of the failing ie tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/Parser.js | 2 | ||||
| -rw-r--r-- | src/scenario/Scenario.js | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/Parser.js b/src/Parser.js index 7ad65f32..8dc8f9c2 100644 --- a/src/Parser.js +++ b/src/Parser.js @@ -93,7 +93,7 @@ function lex(text, parseStringsForObjects){ } function isWhitespace(ch) { return ch == ' ' || ch == '\r' || ch == '\t' || - ch == '\n' || ch == '\v'; + ch == '\n' || ch == '\v' || ch == '\u00A0'; // IE treats non-breaking space as \u00A0 } function isIdent(ch) { return 'a' <= ch && ch <= 'z' || diff --git a/src/scenario/Scenario.js b/src/scenario/Scenario.js index b1782cf2..57fece6e 100644 --- a/src/scenario/Scenario.js +++ b/src/scenario/Scenario.js @@ -64,7 +64,7 @@ angular.scenario.matcher = angular.scenario.matcher || function(name, fn) { prefix += 'not '; } var self = this; - this.addFuture(prefix + name + ' ' + angular.toJson(expected), + this.addFuture(prefix + name + ' ' + angular.toJson(expected), function(done) { var error; self.actual = self.future.value; @@ -129,7 +129,7 @@ function formatException(error, maxStackLines) { } /** - * Returns a function that gets the file name and line number from a + * Returns a function that gets the file name and line number from a * location in the stack if available based on the call site. * * Note: this returns another function because accessing .stack is very @@ -137,10 +137,10 @@ function formatException(error, maxStackLines) { */ function callerFile(offset) { var error = new Error(); - + return function() { var line = (error.stack || '').split('\n')[offset]; - + // Clean up the stack trace line if (line) { if (line.indexOf('@') !== -1) { @@ -151,7 +151,7 @@ function callerFile(offset) { line = line.substring(line.indexOf('(')+1).replace(')', ''); } } - + return line || ''; }; } @@ -188,6 +188,12 @@ function browserTrigger(element, type) { type = 'change'; } if (msie) { + switch(element.type) { + case 'radio': + case 'checkbox': + element.checked = !element.checked; + break; + } element.fireEvent('on' + type); } else { var evnt = document.createEvent('MouseEvents'); @@ -200,9 +206,9 @@ function browserTrigger(element, type) { * Don't use the jQuery trigger method since it works incorrectly. * * jQuery notifies listeners and then changes the state of a checkbox and - * does not create a real browser event. A real click changes the state of + * does not create a real browser event. A real click changes the state of * the checkbox and then notifies listeners. - * + * * To work around this we instead use our own handler that fires a real event. */ _jQuery.fn.trigger = function(type) { |
