Skip to content

Commit

Permalink
Merge pull request #2301 from jsoref/spelling
Browse files Browse the repository at this point in the history
Spelling
  • Loading branch information
mbest committed Sep 28, 2017
2 parents 19d5022 + 25e33a9 commit bd13741
Show file tree
Hide file tree
Showing 21 changed files with 50 additions and 50 deletions.
6 changes: 3 additions & 3 deletions spec/asyncBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ describe('Rate-limited', function() {
expect(notifySpy).toHaveBeenCalledWith('a');
});

it('Uses latest settings for future notification and previous settings for pending notificaiton', function() {
it('Uses latest settings for future notification and previous settings for pending notification', function() {
// This test describes the current behavior for the given scenario but is not a contract for that
// behavior, which could change in the future if convenient.
var subscribable = new ko.subscribable().extend({rateLimit:250});
var notifySpy = jasmine.createSpy('notifySpy');
subscribable.subscribe(notifySpy);

subscribable.notifySubscribers('a'); // Pending notificaiton
subscribable.notifySubscribers('a'); // Pending notification

// Apply new setting and schedule new notification
subscribable = subscribable.extend({rateLimit:500});
Expand Down Expand Up @@ -636,7 +636,7 @@ describe('Rate-limited', function() {
}
}).extend({rateLimit:500});

// Initially the computed evaluated sucessfully
// Initially the computed evaluated successfully
expect(computed()).toEqual(1);

expect(function () {
Expand Down
4 changes: 2 additions & 2 deletions spec/bindingDependencyBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ describe('Binding dependencies', function() {
expect(testNode).toContainText('substitute');
expect(observable.getSubscriptionsCount()).toEqual(1);

// uptdate observable to update binding
// update observable to update binding
observable('new value');
expect(testNode).toContainText('new value');
});
Expand Down Expand Up @@ -489,7 +489,7 @@ describe('Binding dependencies', function() {
});

it('Should leave bindings without an "after" value where they are', function() {
// This test is set up to be unambiguous, because only test1 and test2 are reorderd
// This test is set up to be unambiguous, because only test1 and test2 are reordered
// (they have the dependency between them) and test3 is left alone.
ko.bindingHandlers.test2.after = ['test1'];
testNode.innerHTML = "<div data-bind='test2, test1, test3'></div>";
Expand Down
2 changes: 1 addition & 1 deletion spec/components/componentBindingBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('Components: Component binding', function() {
});

it('Injects and binds the component synchronously if it is flagged as synchronous and already cached, even if it previously loaded asynchronously', function() {
// Set up a component that loads asynchonously, but is flagged as being injectable synchronously
// Set up a component that loads asynchronously, but is flagged as being injectable synchronously
this.restoreAfter(window, 'require');
var requireCallbacks = {};
window.require = function(moduleNames, callback) {
Expand Down
2 changes: 1 addition & 1 deletion spec/components/defaultLoaderBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Components: Default loader', function() {
}).toThrow();
});

it('Throws if you try to register a falsey value', function() {
it('Throws if you try to register a falsy value', function() {
expect(function() {
ko.components.register(testComponentName, null);
}).toThrow();
Expand Down
2 changes: 1 addition & 1 deletion spec/defaultBindings/foreachBehaviors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('Binding: Foreach', function() {
beforeEach(jasmine.prepareTestNode);

it('Should remove descendant nodes from the document (and not bind them) if the value is falsey', function() {
it('Should remove descendant nodes from the document (and not bind them) if the value is falsy', function() {
testNode.innerHTML = "<div data-bind='foreach: someItem'><span data-bind='text: someItem.nonExistentChildProp'></span></div>";
expect(testNode.childNodes[0].childNodes.length).toEqual(1);
ko.applyBindings({ someItem: null }, testNode);
Expand Down
2 changes: 1 addition & 1 deletion spec/defaultBindings/hasfocusBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ko.utils.arrayForEach(['hasfocus', 'hasFocus'], function(binding) {
expect(didFocusAgain).toEqual(false);

// Similarly, when the elem is already blurred, changing the model value to a different
// falsey value shouldn't cause any additional blur events
// falsy value shouldn't cause any additional blur events
model.isFocused(false);
var didBlurAgain = false;
ko.utils.registerEventHandler(testNode.childNodes[0], "focusout", function() { didBlurAgain = true });
Expand Down
2 changes: 1 addition & 1 deletion spec/defaultBindings/ifBehaviors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('Binding: If', function() {
beforeEach(jasmine.prepareTestNode);

it('Should remove descendant nodes from the document (and not bind them) if the value is falsey', function() {
it('Should remove descendant nodes from the document (and not bind them) if the value is falsy', function() {
testNode.innerHTML = "<div data-bind='if: someItem'><span data-bind='text: someItem.nonExistentChildProp'></span></div>";
expect(testNode.childNodes[0].childNodes.length).toEqual(1);
ko.applyBindings({ someItem: null }, testNode);
Expand Down
6 changes: 3 additions & 3 deletions spec/defaultBindings/ifnotBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Binding: Ifnot', function() {
expect(testNode.childNodes[0].childNodes.length).toEqual(0);
});

it('Should leave descendant nodes in the document (and bind them) if the value is falsey, independently of the active template engine', function() {
it('Should leave descendant nodes in the document (and bind them) if the value is falsy, independently of the active template engine', function() {
this.after(function() { ko.setTemplateEngine(new ko.nativeTemplateEngine()); });

ko.setTemplateEngine(new ko.templateEngine()); // This template engine will just throw errors if you try to use it
Expand All @@ -19,7 +19,7 @@ describe('Binding: Ifnot', function() {
expect(testNode.childNodes[0].childNodes[0]).toContainText("Child prop value");
});

it('Should leave descendant nodes unchanged if the value is falsey and remains falsey when changed', function() {
it('Should leave descendant nodes unchanged if the value is falsy and remains falsy when changed', function() {
var someItem = ko.observable(false);
testNode.innerHTML = "<div data-bind='ifnot: someItem'><span data-bind='text: someItem()'></span></div>";
var originalNode = testNode.childNodes[0].childNodes[0];
Expand All @@ -29,7 +29,7 @@ describe('Binding: Ifnot', function() {
expect(testNode.childNodes[0].childNodes[0]).toContainText("false");
expect(testNode.childNodes[0].childNodes[0]).toEqual(originalNode);

// Change the value to a different falsey value
// Change the value to a different falsy value
someItem(0);
expect(testNode.childNodes[0].childNodes[0]).toContainText("0");
expect(testNode.childNodes[0].childNodes[0]).toEqual(originalNode);
Expand Down
2 changes: 1 addition & 1 deletion spec/defaultBindings/withBehaviors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('Binding: With', function() {
beforeEach(jasmine.prepareTestNode);

it('Should remove descendant nodes from the document (and not bind them) if the value is falsey', function() {
it('Should remove descendant nodes from the document (and not bind them) if the value is falsy', function() {
testNode.innerHTML = "<div data-bind='with: someItem'><span data-bind='text: someItem.nonExistentChildProp'></span></div>";
expect(testNode.childNodes[0].childNodes.length).toEqual(1);
ko.applyBindings({ someItem: null }, testNode);
Expand Down
28 changes: 14 additions & 14 deletions spec/dependentObservableBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ describe('Dependent Observable', function() {

it('Should automatically update value when a dependency changes', function () {
var observable = new ko.observable(1);
var depedentObservable = ko.computed(function () { return observable() + 1; });
expect(depedentObservable()).toEqual(2);
var dependentObservable = ko.computed(function () { return observable() + 1; });
expect(dependentObservable()).toEqual(2);

observable(50);
expect(depedentObservable()).toEqual(51);
expect(dependentObservable()).toEqual(51);
});

it('Should be able to use \'peek\' on an observable to avoid a dependency', function() {
Expand Down Expand Up @@ -177,12 +177,12 @@ describe('Dependent Observable', function() {
var observableB = new ko.observable("B");
var observableToUse = "A";
var timesEvaluated = 0;
var depedentObservable = ko.computed(function () {
var dependentObservable = ko.computed(function () {
timesEvaluated++;
return observableToUse == "A" ? observableA() : observableB();
});

expect(depedentObservable()).toEqual("A");
expect(dependentObservable()).toEqual("A");
expect(timesEvaluated).toEqual(1);

// Changing an unrelated observable doesn't trigger evaluation
Expand All @@ -192,7 +192,7 @@ describe('Dependent Observable', function() {
// Switch to other observable
observableToUse = "B";
observableA("A2");
expect(depedentObservable()).toEqual("B2");
expect(dependentObservable()).toEqual("B2");
expect(timesEvaluated).toEqual(2);

// Now changing the first observable doesn't trigger evaluation
Expand All @@ -203,8 +203,8 @@ describe('Dependent Observable', function() {
it('Should notify subscribers of changes', function () {
var notifiedValue;
var observable = new ko.observable(1);
var depedentObservable = ko.computed(function () { return observable() + 1; });
depedentObservable.subscribe(function (value) { notifiedValue = value; });
var dependentObservable = ko.computed(function () { return observable() + 1; });
dependentObservable.subscribe(function (value) { notifiedValue = value; });

expect(notifiedValue).toEqual(undefined);
observable(2);
Expand All @@ -227,20 +227,20 @@ describe('Dependent Observable', function() {
it('Should notify "beforeChange" subscribers before changes', function () {
var notifiedValue;
var observable = new ko.observable(1);
var depedentObservable = ko.computed(function () { return observable() + 1; });
depedentObservable.subscribe(function (value) { notifiedValue = value; }, null, "beforeChange");
var dependentObservable = ko.computed(function () { return observable() + 1; });
dependentObservable.subscribe(function (value) { notifiedValue = value; }, null, "beforeChange");

expect(notifiedValue).toEqual(undefined);
observable(2);
expect(notifiedValue).toEqual(2);
expect(depedentObservable()).toEqual(3);
expect(dependentObservable()).toEqual(3);
});

it('Should only update once when each dependency changes, even if evaluation calls the dependency multiple times', function () {
var notifiedValues = [];
var observable = new ko.observable();
var depedentObservable = ko.computed(function () { return observable() * observable(); });
depedentObservable.subscribe(function (value) { notifiedValues.push(value); });
var dependentObservable = ko.computed(function () { return observable() * observable(); });
dependentObservable.subscribe(function (value) { notifiedValues.push(value); });
observable(2);
expect(notifiedValues.length).toEqual(1);
expect(notifiedValues[0]).toEqual(4);
Expand Down Expand Up @@ -512,7 +512,7 @@ describe('Dependent Observable', function() {
}
});

// Initially the computed evaluated sucessfully
// Initially the computed evaluated successfully
expect(computed()).toEqual(1);

expect(function () {
Expand Down
6 changes: 3 additions & 3 deletions spec/expressionRewritingBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('Expression Rewriting', function() {
var rewritten = ko.expressionRewriting.preProcessBindings(
'a : 1, b : firstName, c : function() { return "returnValue"; }, ' +
'd: firstName+lastName, e: boss.firstName, f: boss . lastName, ' +
'g: getAssitant(), h: getAssitant().firstName, i: getAssitant("[dummy]")[ "lastName" ], ' +
'g: getAssistant(), h: getAssistant().firstName, i: getAssistant("[dummy]")[ "lastName" ], ' +
'j: boss.firstName + boss.lastName'
);

Expand All @@ -111,7 +111,7 @@ describe('Expression Rewriting', function() {
var model = {
firstName: "bob", lastName: "smith",
boss: { firstName: "rick", lastName: "martin" },
getAssitant: function() { return assistant }
getAssistant: function() { return assistant }
};
with (model) {
var parsed = eval("({" + rewritten + "})");
Expand Down Expand Up @@ -195,7 +195,7 @@ describe('Expression Rewriting', function() {
"model: router.activeItem, //wiring the router\n" +
"afterCompose: router.afterCompose, //wiring the router\n" +
"//transition:'entrance', //use the 'entrance' transition when switching views\n" +
"skipTransitionOnSameViewId: true,//Transition entrance is disabled for better perfomance\n" +
"skipTransitionOnSameViewId: true,//Transition entrance is disabled for better performance\n" +
"cacheViews:true //telling composition to keep views in the dom, and reuse them (only a good idea with singleton view models)\n");
expect(result).toEqual([
{ key: 'model', value: 'router.activeItem' },
Expand Down
2 changes: 1 addition & 1 deletion spec/mappingHelperBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Mapping helpers', function() {
var date = new Date();
var string = new String();
var number = new Number();
var booleanValue = new Boolean(); // 'boolean' is a resever word in Javascript
var booleanValue = new Boolean(); // 'boolean' is a resever word in JavaScript

var result = ko.toJS({
regExp: ko.observable(regExp),
Expand Down
2 changes: 1 addition & 1 deletion spec/nodePreprocessingBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Node preprocessing', function() {
ko.bindingProvider.instance = new preprocessingBindingProvider();
});

it('Can leave the nodes unchanged by returning a falsey value', function() {
it('Can leave the nodes unchanged by returning a falsy value', function() {
ko.bindingProvider.instance.preprocessNode = function(node) { return null; };
testNode.innerHTML = "<p data-bind='text: someValue'></p>";
ko.applyBindings({ someValue: 'hello' }, testNode);
Expand Down
6 changes: 3 additions & 3 deletions spec/onErrorBehaviors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('onError handler', function () {
var koOnErrorCount = 0;
var windowOnErrorCount = 0;
var windowOnErrorOrginal;
var windowOnErrorOriginal;
var lastSeenError = null;

beforeEach(function () {
Expand All @@ -28,7 +28,7 @@ describe('onError handler', function () {
koOnErrorCount = 0;
windowOnErrorCount = 0;

windowOnErrorOrginal = window.onerror;
windowOnErrorOriginal = window.onerror;

window.onerror = function () {
windowOnErrorCount++;
Expand All @@ -42,7 +42,7 @@ describe('onError handler', function () {
});

afterEach(function () {
window.onerror = windowOnErrorOrginal;
window.onerror = windowOnErrorOriginal;
ko.onError = null;
lastSeenError = null;
});
Expand Down
4 changes: 2 additions & 2 deletions spec/pureComputedBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('Pure Computed', function() {
// Accessing the computed evaluates it
expect(computed()).toEqual('A');

// No subscription is registered on the depenedent observable
// No subscription is registered on the dependent observable
expect(data.getSubscriptionsCount()).toEqual(0);

// getDependenciesCount returns the correct number
Expand Down Expand Up @@ -162,7 +162,7 @@ describe('Pure Computed', function() {
expect(notifiedValues).toEqual(['B']);
});

it('Should go back to sleep when all subcriptions are disposed', function() {
it('Should go back to sleep when all subscriptions are disposed', function() {
var data = ko.observable('A'),
computed = ko.pureComputed(data),
subscription = computed.subscribe(function () {});
Expand Down
2 changes: 1 addition & 1 deletion spec/utilsBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ describe('Function.bind', function() {
expect(bound('a')).toEqual([object, 'a']);
});

it('should accept a falsey `thisArg` argument', function () {
it('should accept a falsy `thisArg` argument', function () {
ko.utils.arrayForEach(['', 0, false, NaN], function (value) {
var bound = fn.bind(value);
expect(bound()[0].constructor).toEqual(Object(value).constructor);
Expand Down
2 changes: 1 addition & 1 deletion src/binding/bindingAttributeSyntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
return this['createChildContext'](dataItemOrAccessor, dataItemAlias, null, { "exportDependencies": true });
};

// Returns the valueAccesor function for a binding value
// Returns the valueAccessor function for a binding value
function makeValueAccessor(value) {
return function() {
return value;
Expand Down
10 changes: 5 additions & 5 deletions src/binding/defaultBindings/attr.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var attrHtmlToJavascriptMap = { 'class': 'className', 'for': 'htmlFor' };
var attrHtmlToJavaScriptMap = { 'class': 'className', 'for': 'htmlFor' };
ko.bindingHandlers['attr'] = {
'update': function(element, valueAccessor, allBindings) {
var value = ko.utils.unwrapObservable(valueAccessor()) || {};
Expand All @@ -12,12 +12,12 @@ ko.bindingHandlers['attr'] = {
if (toRemove)
element.removeAttribute(attrName);

// In IE <= 7 and IE8 Quirks Mode, you have to use the Javascript property name instead of the
// In IE <= 7 and IE8 Quirks Mode, you have to use the JavaScript property name instead of the
// HTML attribute name for certain attributes. IE8 Standards Mode supports the correct behavior,
// but instead of figuring out the mode, we'll just set the attribute through the Javascript
// but instead of figuring out the mode, we'll just set the attribute through the JavaScript
// property for IE <= 8.
if (ko.utils.ieVersion <= 8 && attrName in attrHtmlToJavascriptMap) {
attrName = attrHtmlToJavascriptMap[attrName];
if (ko.utils.ieVersion <= 8 && attrName in attrHtmlToJavaScriptMap) {
attrName = attrHtmlToJavaScriptMap[attrName];
if (toRemove)
element.removeAttribute(attrName);
else
Expand Down
6 changes: 3 additions & 3 deletions src/subscribables/dependentObservable.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,12 @@ var pureComputedOverrides = {
}
} else {
// First put the dependencies in order
var dependeciesOrder = [];
var dependenciesOrder = [];
ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) {
dependeciesOrder[dependency._order] = id;
dependenciesOrder[dependency._order] = id;
});
// Next, subscribe to each one
ko.utils.arrayForEach(dependeciesOrder, function (id, order) {
ko.utils.arrayForEach(dependenciesOrder, function (id, order) {
var dependency = state.dependencyTracking[id],
subscription = computedObservable.subscribeToDependency(dependency._target);
subscription._order = order;
Expand Down
2 changes: 1 addition & 1 deletion src/subscribables/mappingHelpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

(function() {
var maxNestedObservableDepth = 10; // Escape the (unlikely) pathalogical case where an observable's current value is itself (or similar reference cycle)
var maxNestedObservableDepth = 10; // Escape the (unlikely) pathological case where an observable's current value is itself (or similar reference cycle)

ko.toJS = function(rootObject) {
if (arguments.length == 0)
Expand Down
2 changes: 1 addition & 1 deletion src/templating/templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
} else {
// Render once for this single data point (or use the viewModel if no data was provided)
var innerBindingContext = ('data' in options) ?
bindingContext.createStaticChildContext(options['data'], options['as']) : // Given an explitit 'data' value, we create a child binding context for it
bindingContext.createStaticChildContext(options['data'], options['as']) : // Given an explicit 'data' value, we create a child binding context for it
bindingContext; // Given no explicit 'data' value, we retain the same binding context
templateComputed = ko.renderTemplate(templateName || element, innerBindingContext, options, element);
}
Expand Down

0 comments on commit bd13741

Please sign in to comment.