Skip to content

Commit

Permalink
Merge pull request knockout#1309 from knockout/v3.1-fix-spec-failures
Browse files Browse the repository at this point in the history
V3.1 fix spec failures
  • Loading branch information
rniemeyer committed Feb 15, 2014
2 parents 27124c9 + 82c7aab commit aa3713e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
3 changes: 1 addition & 2 deletions build/knockout-raw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var DEBUG = true,
jQuery = window.jQuery,
JSON = window.JSON;
jQuery = window.jQuery;

// This script adds <script> tags referencing each of the knockout.js source files in the correct order
// It uses JSONP to fetch the list of source files from source-references.js
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "knockout",
"description": "Knockout makes it easier to create rich, responsive UIs with JavaScript",
"homepage": "http://knockoutjs.com/",
"version": "3.0.0",
"version": "3.1.0beta",
"license": "MIT",
"author": "The Knockout.js team",
"main": "build/output/knockout-latest.debug.js",
Expand Down
2 changes: 1 addition & 1 deletion spec/defaultBindings/optionsBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('Binding: Options', function() {
});

it('Should select first option when removing the selected option and the original first option', function () {
// This test failed in IE<=8 without changes made in #1208
// This test failed in IE<=8 and Firefox without changes made in #1208
testNode.innerHTML = '<select data-bind="options: filterValues, optionsText: \'x\', optionsValue: \'x\'">';
var viewModel = {
filterValues: ko.observableArray([{x:1},{x:2},{x:3}])
Expand Down
9 changes: 4 additions & 5 deletions spec/runner.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<!-- All specs should pass with or without jQuery+Modernizr being referenced -->
<!--<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.js"></script>-->
<!--<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-1.7-development-only.js"></script>-->

<!-- jasmine -->
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.2.0/jasmine.css" />
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine.js"></script>
Expand All @@ -16,6 +11,10 @@
<link rel="stylesheet" type="text/css" href="lib/jasmine.extensions.css" />
<script type="text/javascript" src="lib/jasmine.extensions.js"></script>

<!-- All specs should pass with or without jQuery+Modernizr being referenced -->
<!--<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.js"></script>-->
<!--<script type="text/javascript" src="http://modernizr.com/downloads/modernizr-latest.js"></script>-->

<!-- knockout polyfills -->
<script type="text/javascript" src="lib/innershiv.js"></script>
<script type="text/javascript" src="lib/json2.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions spec/utilsBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ describe('arrayFirst', function () {

beforeEach(function () {
matchB = jasmine.createSpy('matchB').andCallFake(function (x) {
return x[0] === "b";
return x.charAt(0) === "b";
});

matchD = jasmine.createSpy('matchD').andCallFake(function (x) {
return x[0] === "d";
return x.charAt(0) === "d";
});
});

Expand Down
12 changes: 5 additions & 7 deletions src/binding/defaultBindings/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,11 @@ ko.bindingHandlers['options'] = {
}

// By using a beforeRemove callback, we delay the removal until after new items are added. This fixes a selection
// problem in IE<=8. See https://github.com/knockout/knockout/issues/1208
if (ko.utils.ieVersion <= 8) {
arrayToDomNodeChildrenOptions['beforeRemove'] =
function (option) {
element.removeChild(option);
};
}
// problem in IE<=8 and Firefox. See https://github.com/knockout/knockout/issues/1208
arrayToDomNodeChildrenOptions['beforeRemove'] =
function (option) {
element.removeChild(option);
};

function setSelectionCallback(arrayEntry, newOptions) {
// IE6 doesn't like us to assign selection to OPTION nodes before they're added to the document.
Expand Down

0 comments on commit aa3713e

Please sign in to comment.