Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Check.typeOf.function -> Check.typeOf.func #4799

Merged
merged 1 commit into from
Jan 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Core/Check.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ define([
* @param {String} name The name of the variable being tested
* @exception {DeveloperError} test must be typeof 'function'
*/
Check.typeOf.function = function (test, name) {
Check.typeOf.func = function (test, name) {
if (typeof test !== 'function') {
throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name));
}
Expand Down
16 changes: 8 additions & 8 deletions Specs/Core/CheckSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@ defineSuite([
}).toThrowDeveloperError();
});

it('Check.typeOf.function does not throw when passed a function', function () {
it('Check.typeOf.func does not throw when passed a function', function () {
expect(function () {
Check.typeOf.function(function () {return true;}, 'mockName');
Check.typeOf.func(function () {return true;}, 'mockName');
}).not.toThrowDeveloperError();
});

it('Check.typeOf.function throws when passed a non-function', function () {
it('Check.typeOf.func throws when passed a non-function', function () {
expect(function () {
Check.typeOf.function({}, 'mockName');
Check.typeOf.func({}, 'mockName');
}).toThrowDeveloperError();
expect(function () {
Check.typeOf.function([], 'mockName');
Check.typeOf.func([], 'mockName');
}).toThrowDeveloperError();
expect(function () {
Check.typeOf.function(1, 'mockName');
Check.typeOf.func(1, 'mockName');
}).toThrowDeveloperError();
expect(function () {
Check.typeOf.function('snth', 'mockName');
Check.typeOf.func('snth', 'mockName');
}).toThrowDeveloperError();
expect(function () {
Check.typeOf.function(true, 'mockName');
Check.typeOf.func(true, 'mockName');
}).toThrowDeveloperError();
});

Expand Down