From 0243aa7790dd79f668a9fd6d0eb89527a034bef9 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 12:39:34 +0200 Subject: [PATCH 01/16] Cheerio: changed "import module" to "import require" --- cheerio/cheerio-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cheerio/cheerio-tests.ts b/cheerio/cheerio-tests.ts index 00cc95ee8b..71d54c5579 100644 --- a/cheerio/cheerio-tests.ts +++ b/cheerio/cheerio-tests.ts @@ -1,6 +1,6 @@ /// -import cheerio = module("cheerio"); +import cheerio = require("cheerio"); var $ = cheerio.load(""); var $el = $('selector'); From 858df696fd0ab4ea6651c9b86b36b8dc77a51c33 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 13:11:42 +0200 Subject: [PATCH 02/16] Logg: changed "import module" to "import require" --- logg/logg-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logg/logg-tests.ts b/logg/logg-tests.ts index 43c1524efe..3569d3caa3 100644 --- a/logg/logg-tests.ts +++ b/logg/logg-tests.ts @@ -1,6 +1,6 @@ /// -import logging = module("logg"); +import logging = require("logg"); var logger = logging.getLogger('my.class'); logger = logging.getTransientLogger('my.class'); From a8fab634083388a7214e3b8d6d360e4368b5dab5 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 13:27:10 +0200 Subject: [PATCH 03/16] Modernizr: fixed "Overload signatures must all be ambient or non-ambient" no need to override alert if we are just testing syntax --- modernizr/modernizr-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modernizr/modernizr-tests.ts b/modernizr/modernizr-tests.ts index 5b7016e126..63ace38440 100644 --- a/modernizr/modernizr-tests.ts +++ b/modernizr/modernizr-tests.ts @@ -2,9 +2,9 @@ declare var $: any; -function alert(thing: any) { +/*function alert(thing: any) { $('#content').append('
' + thing + '
'); -} +}*/ $(function () { var audio = new Audio(); From 844b0298b2b93e29e06ddf3a2c5c938661a64a1a Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 13:43:01 +0200 Subject: [PATCH 04/16] MsNodeSql: fixed QueryCallback and tests --- msnodesql/msnodesql-tests.ts | 4 ++-- msnodesql/msnodesql.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/msnodesql/msnodesql-tests.ts b/msnodesql/msnodesql-tests.ts index c197baf9fd..3f05f29aa8 100644 --- a/msnodesql/msnodesql-tests.ts +++ b/msnodesql/msnodesql-tests.ts @@ -17,12 +17,12 @@ function test_streaming() { function test_explicit() { var conn_str = "Driver={SQL Server Native Client 11.0};Server={(localdb)\\v11.0};Database={DBName};Trusted_Connection={Yes};"; - sql.open(conn_str, function (err, conn) { + sql.open(conn_str, function (err?: Error, connection?: sql.Connection) { if (err) { console.log("Error opening the connection!"); return; } - conn.queryRaw("SELECT * FROM TestTable", function (err, results) { + connection.queryRaw("SELECT * FROM TestTable", function (err?: Error, results?: sql.QueryRawResult, more?: boolean) { if (err) { console.log("Error running query!"); return; diff --git a/msnodesql/msnodesql.d.ts b/msnodesql/msnodesql.d.ts index a9d008c43c..744db70f24 100644 --- a/msnodesql/msnodesql.d.ts +++ b/msnodesql/msnodesql.d.ts @@ -20,7 +20,7 @@ declare module "msnodesql" { } interface QueryCallback { - (err?: Error, results?: any[], more?: boolean): void; + (err?: Error, results?: QueryRawResult, more?: boolean): void; } interface QueryRawCallback { From a5172bd3b054f725564874f77937d8ffbff13b63 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 13:48:36 +0200 Subject: [PATCH 05/16] Mode_Redis: fixed date difference logging --- node_redis/node_redis-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_redis/node_redis-tests.ts b/node_redis/node_redis-tests.ts index 1758f5eb53..4dcd432816 100644 --- a/node_redis/node_redis-tests.ts +++ b/node_redis/node_redis-tests.ts @@ -1802,7 +1802,7 @@ run_next_test = function run_next_test() { test_count += 1; tests[test_name](); } else { - console.log('\n completed \x1b[32m%d\x1b[0m tests in \x1b[33m%d\x1b[0m ms\n', test_count, new Date() - all_start); + console.log('\n completed \x1b[32m%d\x1b[0m tests in \x1b[33m%d\x1b[0m ms\n', test_count, Date.now() - all_start); client.quit(); client2.quit(); } From 202a9918e2f3adc34069eb66489068a3710906bc Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 13:51:53 +0200 Subject: [PATCH 06/16] PhoneGap: fixed two "Duplicate identifier" errors in tests --- phonegap/phonegap-tests.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phonegap/phonegap-tests.ts b/phonegap/phonegap-tests.ts index 2eabf75b02..273551c11d 100644 --- a/phonegap/phonegap-tests.ts +++ b/phonegap/phonegap-tests.ts @@ -107,21 +107,21 @@ function test_capture() { } var options = { limit: 3, duration: 10 }; navigator.device.capture.captureAudio(captureSuccess, captureError, options); - var captureSuccess = function (mediaFiles) { + function captureSuccess2(mediaFiles) { var i, path, len; for (i = 0, len = mediaFiles.length; i < len; i += 1) { path = mediaFiles[i].fullPath; } }; - var captureError = function (error) { + function captureError2(error) { navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); }; - navigator.device.capture.captureImage(captureSuccess, captureError, { limit: 2 }); + navigator.device.capture.captureImage(captureSuccess2, captureError2, { limit: 2 }); function captureImage() { - navigator.device.capture.captureImage(captureSuccess, captureError, { limit: 2 }); + navigator.device.capture.captureImage(captureSuccess2, captureError2, { limit: 2 }); } function captureVideo() { - navigator.device.capture.captureVideo(captureSuccess, captureError, { limit: 2 }); + navigator.device.capture.captureVideo(captureSuccess2, captureError2, { limit: 2 }); } } From 822274f76e55821c4cb6855568f1609ba6ca9aa9 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 13:58:40 +0200 Subject: [PATCH 07/16] PouchDB: fixed alert function override --- pouchDB/pouch-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pouchDB/pouch-tests.ts b/pouchDB/pouch-tests.ts index 46411b5ba2..8cca2ed710 100644 --- a/pouchDB/pouch-tests.ts +++ b/pouchDB/pouch-tests.ts @@ -2,7 +2,7 @@ declare var $: any; -function alert(thing: any) { +window.alert = function(thing?: string) { $('body').append('
' + thing + '
'); } From 7ab35b92ffb5c1b4d91befa2b30502208646b655 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 13:59:42 +0200 Subject: [PATCH 08/16] Modernizr: fixed alert function override --- modernizr/modernizr-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modernizr/modernizr-tests.ts b/modernizr/modernizr-tests.ts index 63ace38440..012b924e6a 100644 --- a/modernizr/modernizr-tests.ts +++ b/modernizr/modernizr-tests.ts @@ -2,9 +2,9 @@ declare var $: any; -/*function alert(thing: any) { +window.alert = function(thing?: string) { $('#content').append('
' + thing + '
'); -}*/ +} $(function () { var audio = new Audio(); From e377e15866df39b4cee6ca47677f3d934668d646 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 14:01:06 +0200 Subject: [PATCH 09/16] Restify: changed "import module" to "import require" --- restify/restify-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restify/restify-tests.ts b/restify/restify-tests.ts index f54882965b..79a56f578c 100644 --- a/restify/restify-tests.ts +++ b/restify/restify-tests.ts @@ -1,6 +1,6 @@ /// -import restify = module("restify"); +import restify = require("restify"); var server = restify.createServer({ formatters: { From fb6444b5a1e03942e9b7a22f75c1d7992310c447 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 14:04:30 +0200 Subject: [PATCH 10/16] Scroller: cast to HTMLElement for getElementsByTagName was needed --- scroller/scroller-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scroller/scroller-tests.ts b/scroller/scroller-tests.ts index 941e05ff17..411ddab92c 100644 --- a/scroller/scroller-tests.ts +++ b/scroller/scroller-tests.ts @@ -41,7 +41,7 @@ function test_canvas() { function test_domlist() { var container = document.getElementById("container"); var content = document.getElementById("content"); - var refreshElem = content.getElementsByTagName("div")[0]; + var refreshElem = content.getElementsByTagName("div")[0]; var scroller = new Scroller(render, { scrollingX: false }); From 8e69c2c60c75f3a23608000ca0f641e107ba9750 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 14:19:55 +0200 Subject: [PATCH 11/16] Unity-WebAPI: added External.getUnityObject --- unity-webapi/unity-webapi.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unity-webapi/unity-webapi.d.ts b/unity-webapi/unity-webapi.d.ts index 451ddab6bc..9170a26c19 100644 --- a/unity-webapi/unity-webapi.d.ts +++ b/unity-webapi/unity-webapi.d.ts @@ -3,6 +3,10 @@ // Definitions by: John Vrbanac | https://github.com/jmvrbanac // Definitions: https://github.com/borisyankov/DefinitelyTyped +interface External { + getUnityObject(version:number):Unity; +} + declare class UnitySettings { public name:String; public iconUrl:String; From d04613e64036801c113419ce26389ab0dcd813f5 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 19:37:03 +0200 Subject: [PATCH 12/16] Sugar: bool changed to boolean --- sugar/sugar.d.ts | 370 +++++++++++++++++++++++------------------------ 1 file changed, 185 insertions(+), 185 deletions(-) diff --git a/sugar/sugar.d.ts b/sugar/sugar.d.ts index e376400b63..c011dcc4b5 100644 --- a/sugar/sugar.d.ts +++ b/sugar/sugar.d.ts @@ -77,7 +77,7 @@ interface String { * 'jumpy'.at(-1) -> 'y' * 'lucky charms'.at(2,4,6,8) -> ['u','k','y',c'] ***/ - at(index: number, loop?: bool): string; + at(index: number, loop?: boolean): string; /** * @see at @@ -96,7 +96,7 @@ interface String { * 'moz-border-radius'.camelize() -> 'MozBorderRadius' * 'moz-border-radius'.camelize(false) -> 'mozBorderRadius' **/ - camelize(first?: bool): string; + camelize(first?: boolean): string; /** * Capitalizes the first character in the string. @@ -111,7 +111,7 @@ interface String { * 'hello kitty'.capitalize(true) -> 'Hello Kitty' * **/ - capitalize(all: bool): string; + capitalize(all: boolean): string; /** * Runs callback [fn] against each character in the string. @@ -220,22 +220,22 @@ interface String { * 'jumpy'.endsWith('MPY') -> false * 'jumpy'.endsWith('MPY', false) -> true **/ - endsWith(find: string, pos?: number, case_?: bool): bool; + endsWith(find: string, pos?: number, case_?: boolean): boolean; /** * @see endsWith **/ - endsWith(find: string, case_?: bool): bool; + endsWith(find: string, case_?: boolean): boolean; /** * @see endsWith **/ - endsWith(find: RegExp, pos?: number, case_?: bool): bool; + endsWith(find: RegExp, pos?: number, case_?: boolean): boolean; /** * @see endsWith **/ - endsWith(find: RegExp, case_?: bool): bool; + endsWith(find: RegExp, case_?: boolean): boolean; /** * Converts HTML characters to their entity equivalents. @@ -265,7 +265,7 @@ interface String { * 'http://foo.com/"bar"'.escapeURL() -> 'http://foo.com/%22bar%22' * 'http://foo.com/"bar"'.escapeURL(true) -> 'http%3A%2F%2Ffoo.com%2F%22bar%22' **/ - escapeURL(param?: bool): string; + escapeURL(param?: boolean): string; /** * Returns the first [n] characters of the string. @@ -321,12 +321,12 @@ interface String { * 'broken'.has(/[a-n]/) -> true * 'broken'.has(/[s-z]/) -> false **/ - has(find: string): bool; + has(find: string): boolean; /** * @see has **/ - has(find: RegExp): bool; + has(find: RegExp): boolean; /** * Returns true if the string contains any characters in Arabic. @@ -338,79 +338,79 @@ interface String { * '??????'.hasKatakana() -> true * "l'année".hasLatin() -> true **/ - hasArabic(): bool; + hasArabic(): boolean; /** * Returns true if the string contains any characters in Cyrillic. * @returns True if the string contains Cyrillic. **/ - hasCyrillic(): bool; + hasCyrillic(): boolean; /** * Returns true if the string contains any characters in Greek. * @returns True if the string contains Greek. **/ - hasGreek(): bool; + hasGreek(): boolean; /** * Returns true if the string contains any characters in Hangul. * @returns True if the string contains Hangul. **/ - hasHangul(): bool; + hasHangul(): boolean; /** * Returns true if the string contains any characters in Han. * @returns True if the string contains Han. **/ - hasHan(): bool; + hasHan(): boolean; /** * Returns true if the string contains any characters in Kanji. * @returns True if the string contains Kanji. **/ - hasKanji(): bool; + hasKanji(): boolean; /** * Returns true if the string contains any characters in Hebrew. * @returns True if the string contains Hebrew. **/ - hasHebrew(): bool; + hasHebrew(): boolean; /** * Returns true if the string contains any characters in Hiragana. * @returns True if the string contains Hiragana. **/ - hasHiragana(): bool; + hasHiragana(): boolean; /** * Returns true if the string contains any characters in Kana. * @returns True if the string contains Kana. **/ - hasKana(): bool; + hasKana(): boolean; /** * Returns true if the string contains any characters in Katakana. * @returns True if the string contains Katakana. **/ - hasKatakana(): bool; + hasKatakana(): boolean; /** * Returns true if the string contains any characters in Latin. * @returns True if the string contains Latin. **/ - hasLatin(): bool; + hasLatin(): boolean; /** * Returns true if the string contains any characters in Thai. * @returns True if the string contains Thai. **/ - hasThai(): bool; + hasThai(): boolean; /** * Returns true if the string contains any characters in Devanagari. * @returns True if the string contains Devanagari. **/ - hasDevanagari(): bool; + hasDevanagari(): boolean; /** * Converts katakana into hiragana. @@ -422,7 +422,7 @@ interface String { * '????'.hiragana() -> '????' * '????'.hiragana(false) -> '????' **/ - hiragana(all?: bool): string; + hiragana(all?: boolean): string; /** * Creates a human readable string. @@ -443,7 +443,7 @@ interface String { * ' '.isBlank() -> true * 'noway'.isBlank() -> false **/ - isBlank(): bool; + isBlank(): boolean; /** * Returns true if the string contains only characters in Arabic. Whitespace is ignored. @@ -455,79 +455,79 @@ interface String { * '??????'.isKatakana() -> false * "l'année".isLatin() -> true **/ - isArabic(): bool; + isArabic(): boolean; /** * Returns true if the string contains only characters in Cyrillic. Whitespace is ignored. * @returns True if the string containsly only characters in Cyrillic. **/ - isCyrillic(): bool; + isCyrillic(): boolean; /** * Returns true if the string contains only characters in Greek. Whitespace is ignored. * @returns True if the string containsly only characters in Greek. **/ - isGreek(): bool; + isGreek(): boolean; /** * Returns true if the string contains only characters in Hangul. Whitespace is ignored. * @returns True if the string containsly only characters in Hangul. **/ - isHangul(): bool; + isHangul(): boolean; /** * Returns true if the string contains only characters in Han. Whitespace is ignored. * @returns True if the string containsly only characters in Han. **/ - isHan(): bool; + isHan(): boolean; /** * Returns true if the string contains only characters in Kanji. Whitespace is ignored. * @returns True if the string containsly only characters in Kanji. **/ - isKanji(): bool; + isKanji(): boolean; /** * Returns true if the string contains only characters in Hebrew. Whitespace is ignored. * @returns True if the string containsly only characters in Hebrew. **/ - isHebrew(): bool; + isHebrew(): boolean; /** * Returns true if the string contains only characters in Hiragana. Whitespace is ignored. * @returns True if the string containsly only characters in Hiragana. **/ - isHiragana(): bool; + isHiragana(): boolean; /** * Returns true if the string contains only characters in Kana. Whitespace is ignored. * @returns True if the string containsly only characters in Kana. **/ - isKana(): bool; + isKana(): boolean; /** * Returns true if the string contains only characters in Katakana. Whitespace is ignored. * @returns True if the string containsly only characters in Katakana. **/ - isKatakana(): bool; + isKatakana(): boolean; /** * Returns true if the string contains only characters in Latin. Whitespace is ignored. * @returns True if the string containsly only characters in Latin. **/ - isLatin(): bool; + isLatin(): boolean; /** * Returns true if the string contains only characters in Thai. Whitespace is ignored. * @returns True if the string containsly only characters in Thai. **/ - isThai(): bool; + isThai(): boolean; /** * Returns true if the string contains only characters in Devanagari. Whitespace is ignored. * @returns True if the string containsly only characters in Devanagari. **/ - isDevanagari(): bool; + isDevanagari(): boolean; /** * Converts hiragana into katakana. @@ -723,22 +723,22 @@ interface String { * 'hello'.startsWith('HELL') -> false * 'hello'.startsWith('HELL', false) -> true **/ - startsWith(find: string, pos?: number, case_?: bool): bool; + startsWith(find: string, pos?: number, case_?: boolean): boolean; /** * @see startsWith **/ - startsWith(find: string, case_?: bool): bool; + startsWith(find: string, case_?: boolean): boolean; /** * @see startsWith **/ - startsWith(find: RegExp, pos?: number, case_?: bool): bool; + startsWith(find: RegExp, pos?: number, case_?: boolean): boolean; /** * @see startsWith **/ - startsWith(find: RegExp, case_?: bool): bool; + startsWith(find: RegExp, case_?: boolean): boolean; /** * Strips all HTML tags from the string. @@ -834,7 +834,7 @@ interface String { * 'just sittin on the dock of the bay'.truncate(20, true, 'middle') -> 'just sitt...of the bay' * 'just sittin on the dock of the bay'.truncate(20, true, 'left') -> '...the dock of the bay' **/ - truncate(length: number, split?: bool, from?: string, ellipsis?: string): string; + truncate(length: number, split?: boolean, from?: string, ellipsis?: string): string; /** * Converts hyphens and camel casing to underscores. @@ -864,7 +864,7 @@ interface String { * 'http%3A%2F%2Ffoo.com%2Fthe%20bar'.unescapeURL() -> 'http://foo.com/the bar' * 'http%3A%2F%2Ffoo.com%2Fthe%20bar'.unescapeURL(true) -> 'http%3A%2F%2Ffoo.com%2Fthe bar' **/ - unescapeURL(partial?: bool): string; + unescapeURL(partial?: boolean): string; /** * Runs callback [fn] against each word in the string. @@ -954,7 +954,7 @@ interface Number { * @see bytes * @limit If false upper limit for units is 'exa'. **/ - bytes(precision?: number, limit?: bool): string; + bytes(precision?: number, limit?: boolean): string; /** * Shortcut for %Math.ceil% that also allows a . @@ -1061,7 +1061,7 @@ interface Number { * (6).isEven() -> true * (17).isEven() -> false **/ - isEven(): bool; + isEven(): boolean; /** * Returns true if the number has no trailing decimal. @@ -1070,7 +1070,7 @@ interface Number { * (420).isInteger() -> true * (4.5).isInteger() -> false **/ - isInteger(): bool; + isInteger(): boolean; /** * Returns true if the number is a multiple of . @@ -1082,7 +1082,7 @@ interface Number { * (32).isMultipleOf(4) -> true * (34).isMultipleOf(4) -> false **/ - isMultipleOf(num: number): bool; + isMultipleOf(num: number): boolean; /** * Returns true if the number is odd. @@ -1091,7 +1091,7 @@ interface Number { * (3).isOdd() -> true * (18).isOdd() -> false **/ - isOdd(): bool; + isOdd(): boolean; /** * Returns the logarithm of the number with base , @@ -1186,7 +1186,7 @@ interface Number { * @see metric * @limit If false the upper limit for the metric units will be 'exa'. **/ - metric(precision?: number, limit?: bool): string; + metric(precision?: number, limit?: boolean): string; /** * Returns an ordinalized (English) string, i.e. "1st", "2nd", etc. @@ -1211,7 +1211,7 @@ interface Number { * (-5).pad(4) -> '-0005' * (82).pad(3, true) -> '+082' **/ - pad(place?: number, sign?: bool, base?: number): string; + pad(place?: number, sign?: boolean, base?: number): string; /** * Shortcut for %Math.round% that also allows a [precision]. @@ -1992,7 +1992,7 @@ interface ArrayStatic { * Array.isArray('wasabi') -> false * Array.isArray([1,2,3]) -> true **/ - isArray(obj: any): bool; + isArray(obj: any): boolean; } interface Array { @@ -2046,7 +2046,7 @@ interface Array { * [1,2,3].at(-1) -> 3 * [1,2,3].at(0,1) -> [1,2] **/ - at(index: number, loop?: bool): T; + at(index: number, loop?: boolean): T; /** * @see at @@ -2089,7 +2089,7 @@ interface Array { * [1,'',2,false,3].compact() -> [1,'',2,false,3] * [1,'',2,false,3].compact(true) -> [1,2,3] **/ - compact(all?: bool): T[]; + compact(all?: boolean): T[]; /** * Counts all elements in the array that match . @@ -2129,9 +2129,9 @@ interface Array { * }, 2, true); **/ each( - fn: (element: T, index: number, array: T[]) => bool, + fn: (element: T, index: number, array: T[]) => boolean, index?: number, - loop?: bool): T[]; + loop?: boolean): T[]; /** * Returns true if all elements in the array match . @@ -2148,23 +2148,23 @@ interface Array { * ['a','a','a'].every('a') -> true * [{a:2},{a:2}].every({a:2}) -> true **/ - every(f: T, scope?: any): bool; + every(f: T, scope?: any): boolean; /** * @see every * @note Already defined in lib.d.ts. **/ - //every(f: (element: T, index: number, array: T[]) => bool, scope?: any): bool; + //every(f: (element: T, index: number, array: T[]) => boolean, scope?: any): boolean; /** * @see every **/ - all(f: T, scope?: any): bool; + all(f: T, scope?: any): boolean; /** * @see every **/ - all(f: (element: T, index: number, array: T[]) => bool, scope?: any): bool; + all(f: (element: T, index: number, array: T[]) => boolean, scope?: any): boolean; /** * Removes any element in the array that matches [f1], [f2], etc. @@ -2183,7 +2183,7 @@ interface Array { /** * @see exclude **/ - exclude(f: (element: T, index: number, array: T[]) => bool): T[]; + exclude(f: (element: T, index: number, array: T[]) => boolean): T[]; /** * Returns any elements in the array that match . @@ -2205,7 +2205,7 @@ interface Array { * @see filter * @note Already defined in lib.d.ts. **/ - //filter(f: (element: T, index: number, array: T[]) => bool, scope?: any): T[]; + //filter(f: (element: T, index: number, array: T[]) => boolean, scope?: any): T[]; /** * Returns the first element that matches . @@ -2223,12 +2223,12 @@ interface Array { * }); -> {a:1,b:3} * ['cuba','japan','canada'].find(/^c/, 2) -> 'canada' **/ - find(f: T, index?: number, loop?: bool): T; + find(f: T, index?: number, loop?: boolean): T; /** * @see find **/ - find(f: (element: T, index: number, array: T[]) => bool, index?: number, loop?: bool): T; + find(f: (element: T, index: number, array: T[]) => boolean, index?: number, loop?: boolean): T; /** * Returns all elements that match . @@ -2247,12 +2247,12 @@ interface Array { * ['cuba','japan','canada'].findAll(/^c/) -> 'cuba','canada' * ['cuba','japan','canada'].findAll(/^c/, 2) -> 'canada' **/ - findAll(f: T, index?: number, loop?: bool): T[]; + findAll(f: T, index?: number, loop?: boolean): T[]; /** * @see findAll **/ - findAll(f: (element: T, index: number, array: T[]) => bool, index?: number, loop?: bool): T[]; + findAll(f: (element: T, index: number, array: T[]) => boolean, index?: number, loop?: boolean): T[]; /** * Returns the index of the first element that matches @@ -2278,12 +2278,12 @@ interface Array { * }); -> 1 * ['one','two','three'].findIndex(/th/); -> 2 **/ - findIndex(f: T, startIndex?: number, loop?: bool): number; + findIndex(f: T, startIndex?: number, loop?: boolean): number; /** * @see findIndex **/ - findIndex(f: (element: T, index: number, array: T[]) => bool, startIndex?: number, loop?: bool): number; + findIndex(f: (element: T, index: number, array: T[]) => boolean, startIndex?: number, loop?: boolean): number; /** * Returns the first element(s) in the array. @@ -2447,7 +2447,7 @@ interface Array { * [].isEmpty() -> true * [null,undefined].isEmpty() -> true ***/ - isEmpty(): bool; + isEmpty(): boolean; /** * Returns the last element(s) in the array. @@ -2636,13 +2636,13 @@ interface Array { * return n['a'] > 1; * }); -> true **/ - none(f: T): bool; + none(f: T): boolean; /** * @see none * @param f Callback function to determine if none of the elements in the array contain a certain value. **/ - none(f: (n: T) => bool): bool; + none(f: (n: T) => boolean): boolean; /*** * Returns a copy of the array with the elements randomized. @@ -2716,7 +2716,7 @@ interface Array { * @see remove * @param fn Callback function to check if elements should be removed. **/ - remove(fn: (n: T) => bool): T[]; + remove(fn: (n: T) => boolean): T[]; /** * Removes element at . If [end] is specified, removes the range @@ -2767,12 +2767,12 @@ interface Array { * ['a','b','c'].some('a') -> true * [{a:2},{b:5}].some({a:2}) -> true **/ - some(f: T, scope?: any): bool; + some(f: T, scope?: any): boolean; /** * @see some **/ - some(f: (n: T) => bool, scope?: any): bool; + some(f: (n: T) => boolean, scope?: any): boolean; /** * Sorts the array by . @@ -2792,12 +2792,12 @@ interface Array { * return n.age; * }); -> [{age:13},{age:18},{age:72}] **/ - sortBy(map: string, desc?: bool): T[]; + sortBy(map: string, desc?: boolean): T[]; /** * @see sortBy **/ - sortBy(fn: (n: T) => U, desc?: bool): T[]; + sortBy(fn: (n: T) => U, desc?: boolean): T[]; /** * Subtracts from the array all elements in [a1], [a2], etc. @@ -2927,7 +2927,7 @@ interface ObjectStatic { * Object.fromQueryString('foo=bar&broken=wear') -> { foo: 'bar', broken: 'wear' } * Object.fromQueryString('foo[]=1&foo[]=2') -> { foo: [1,2] } **/ - fromQueryString(str: string, deep?: bool): T; + fromQueryString(str: string, deep?: boolean): T; /** * Returns true if is an object of that type. @@ -2955,47 +2955,47 @@ interface ObjectStatic { * Object.isRegExp(/wasabi/) -> true * Object.isObject({ broken:'wear' }) -> true **/ - isArray(obj: any): bool; + isArray(obj: any): boolean; /** * @see isArray **/ - isObject(obj: any): bool; + isObject(obj: any): boolean; /** * @see isArray **/ - isBoolean(obj: any): bool; + isBoolean(obj: any): boolean; /** * @see isArray **/ - isDate(obj: any): bool; + isDate(obj: any): boolean; /** * @see isArray **/ - isFunction(obj: any): bool; + isFunction(obj: any): boolean; /** * @see isArray **/ - isNaN(obj: any): bool; + isNaN(obj: any): boolean; /** * @see isArray **/ - isNumber(obj: any): bool; + isNumber(obj: any): boolean; /** * @see isArray **/ - isString(obj: any): bool; + isString(obj: any): boolean; /** * @see isArray **/ - isRegExp(obj: any): bool; + isRegExp(obj: any): boolean; /** * Converts the object into a query string. Accepts deep nested objects and arrays. @@ -3019,7 +3019,7 @@ interface ObjectStatic { * Object.clone() -> {} * Object.extended({foo:'bar'}).clone() -> { foo: 'bar' } **/ - clone(obj?: T, deep?: bool): T; + clone(obj?: T, deep?: boolean): T; /** * Enumerable methods in the Array package are also available to @@ -3063,32 +3063,32 @@ interface ObjectStatic { /** * @see map **/ - any(obj: any, map: string): bool; + any(obj: any, map: string): boolean; /** * @see map **/ - any(obj: any, map: (key: string, value: any) => bool): bool; + any(obj: any, map: (key: string, value: any) => boolean): boolean; /** * @see map **/ - all(obj: any, map: string): bool; + all(obj: any, map: string): boolean; /** * @see map **/ - all(obj: any, map: (key: string, value: any) => bool): bool; + all(obj: any, map: (key: string, value: any) => boolean): boolean; /** * @see map **/ - none(obj: any, map: string): bool; + none(obj: any, map: string): boolean; /** * @see map **/ - none(obj: any, map: (key: string, value: any) => bool): bool; + none(obj: any, map: (key: string, value: any) => boolean): boolean; /** * @see map @@ -3098,7 +3098,7 @@ interface ObjectStatic { /** * @see map **/ - count(obj: any, map: (key: string, value: any) => bool): number; + count(obj: any, map: (key: string, value: any) => boolean): number; /** * @see map @@ -3108,7 +3108,7 @@ interface ObjectStatic { /** * @see map **/ - find(obj: any, map: (key: string, value: any) => bool): any; + find(obj: any, map: (key: string, value: any) => boolean): any; /** * @see map @@ -3118,7 +3118,7 @@ interface ObjectStatic { /** * @see map **/ - findAll(obj: any, map: (key: string, value: any) => bool): any[]; + findAll(obj: any, map: (key: string, value: any) => boolean): any[]; /** * @see map @@ -3133,7 +3133,7 @@ interface ObjectStatic { /** * @see map **/ - isEmpty(obj: any): bool; + isEmpty(obj: any): boolean; /** * @see map @@ -3208,7 +3208,7 @@ interface ObjectStatic { * Object.equal({a:2}, {a:3}) -> false * Object.extended({a:2}).equals({a:3}) -> false **/ - equal(a: any, b: any): bool; + equal(a: any, b: any): boolean; /** * Checks if has using hasOwnProperty from Object.prototype. @@ -3224,7 +3224,7 @@ interface ObjectStatic { * Object.has({ foo: 'bar' }, 'baz') -> false * Object.has({ hasOwnProperty: true }, 'foo') -> false **/ - has(obj: any, key: string): bool; + has(obj: any, key: string): boolean; /** * Returns an array containing the keys in . Optionally calls [fn] for each key. @@ -3267,13 +3267,13 @@ interface ObjectStatic { * }); -> { a:3 } * Object.extended({a:1}).merge({b:2}) -> { a:1, b:2 } **/ - merge(target: any, source: any, deep?: bool, resolve?: bool): any; + merge(target: any, source: any, deep?: boolean, resolve?: boolean): any; /** * @see merge * @param resolve Callback to resolve conflicts in the merge. **/ - merge(target: any, source: any, deep?: bool, resolve?: (key: string, targetVal: any, sourceVal: any) => any): any; + merge(target: any, source: any, deep?: boolean, resolve?: (key: string, targetVal: any, sourceVal: any) => any): any; /** * Builds a new object containing all values except those specified in find. @@ -3416,47 +3416,47 @@ interface Object { * Object.isRegExp(/wasabi/) -> true * Object.isObject({ broken:'wear' }) -> true **/ - isArray(): bool; + isArray(): boolean; /** * @see isArray **/ - isObject(): bool; + isObject(): boolean; /** * @see isArray **/ - isBoolean(): bool; + isBoolean(): boolean; /** * @see isArray **/ - isDate(): bool; + isDate(): boolean; /** * @see isArray **/ - isFunction(): bool; + isFunction(): boolean; /** * @see isArray **/ - isNaN(): bool; + isNaN(): boolean; /** * @see isArray **/ - isNumber(): bool; + isNumber(): boolean; /** * @see isArray **/ - isString(): bool; + isString(): boolean; /** * @see isArray **/ - isRegExp(): bool; + isRegExp(): boolean; /** * Converts the object into a query string. Accepts deep nested objects and arrays. @@ -3478,7 +3478,7 @@ interface Object { * Object.clone() -> {} * Object.extended({foo:'bar'}).clone() -> { foo: 'bar' } **/ - clone(deep?: bool): any; + clone(deep?: boolean): any; /** * Enumerable methods in the Array package are also available to @@ -3522,32 +3522,32 @@ interface Object { /** * @see map **/ - any(map: string): bool; + any(map: string): boolean; /** * @see map **/ - any(map: (key: string, value: any) => bool): bool; + any(map: (key: string, value: any) => boolean): boolean; /** * @see map **/ - all(map: string): bool; + all(map: string): boolean; /** * @see map **/ - all(map: (key: string, value: any) => bool): bool; + all(map: (key: string, value: any) => boolean): boolean; /** * @see map **/ - none(map: string): bool; + none(map: string): boolean; /** * @see map **/ - none(map: (key: string, value: any) => bool): bool; + none(map: (key: string, value: any) => boolean): boolean; /** * @see map @@ -3557,7 +3557,7 @@ interface Object { /** * @see map **/ - count(map: (key: string, value: any) => bool): number; + count(map: (key: string, value: any) => boolean): number; /** * @see map @@ -3567,7 +3567,7 @@ interface Object { /** * @see map **/ - find(map: (key: string, value: any) => bool): any; + find(map: (key: string, value: any) => boolean): any; /** * @see map @@ -3577,7 +3577,7 @@ interface Object { /** * @see map **/ - findAll(map: (key: string, value: any) => bool): any[]; + findAll(map: (key: string, value: any) => boolean): any[]; /** * @see map @@ -3592,7 +3592,7 @@ interface Object { /** * @see map **/ - isEmpty(): bool; + isEmpty(): boolean; /** * @see map @@ -3666,7 +3666,7 @@ interface Object { * Object.equal({a:2}, {a:3}) -> false * Object.extended({a:2}).equals({a:3}) -> false **/ - equal(b: any): bool; + equal(b: any): boolean; /** * Checks if has using hasOwnProperty from Object.prototype. @@ -3681,7 +3681,7 @@ interface Object { * Object.has({ foo: 'bar' }, 'baz') -> false * Object.has({ hasOwnProperty: true }, 'foo') -> false **/ - has(key: string): bool; + has(key: string): boolean; /** * Returns an array containing the keys in . Optionally calls [fn] for each key. @@ -3722,13 +3722,13 @@ interface Object { * }); -> { a:3 } * Object.extended({a:1}).merge({b:2}) -> { a:1, b:2 } **/ - merge(source: any, deep?: bool, resolve?: bool): any; + merge(source: any, deep?: boolean, resolve?: boolean): any; /** * @see merge * @param resolve Callback to resolve conflicts in the merge. **/ - merge(source: any, deep?: bool, resolve?: (key: string, targetVal: any, sourceVal: any) => any): any; + merge(source: any, deep?: boolean, resolve?: (key: string, targetVal: any, sourceVal: any) => any): any; /** * Builds a new object containing all values except those specified in find. @@ -4040,7 +4040,7 @@ interface RegExp { } interface Locale { - plural: bool; + plural: boolean; months: string; weekdays: string; units: string; @@ -4227,42 +4227,42 @@ interface Date { * Date.create().addDays(5) -> current time + 5 days * Date.create().addYears(5) -> current time + 5 years **/ - addMilliseconds(num: number, reset?: bool): Date; + addMilliseconds(num: number, reset?: boolean): Date; /** * @see addMilliseconds **/ - addSeconds(num: number, reset?: bool): Date; + addSeconds(num: number, reset?: boolean): Date; /** * @see addMilliseconds **/ - addMinutes(num: number, reset?: bool): Date; + addMinutes(num: number, reset?: boolean): Date; /** * @see addMilliseconds **/ - addHours(num: number, reset?: bool): Date; + addHours(num: number, reset?: boolean): Date; /** * @see addMilliseconds **/ - addDays(num: number, reset?: bool): Date; + addDays(num: number, reset?: boolean): Date; /** * @see addMilliseconds **/ - addWeeks(num: number, reset?: bool): Date; + addWeeks(num: number, reset?: boolean): Date; /** * @see addMilliseconds **/ - addMonths(num: number, reset?: bool): Date; + addMonths(num: number, reset?: boolean): Date; /** * @see addMilliseconds **/ - addYears(num: number, reset?: bool): Date; + addYears(num: number, reset?: boolean): Date; /** * Sets the date forward. @@ -4281,7 +4281,7 @@ interface Date { * new Date().advance(0, 2, 3) -> 2 months 3 days in the future * new Date().advance(86400000) -> 1 day in the future **/ - advance(set: string, reset?: bool): Date; + advance(set: string, reset?: boolean): Date; /** * @see advance @@ -4289,19 +4289,19 @@ interface Date { * @param month MM to advance. * @param day DD to advance. **/ - advance(year: number, month: number, day: number, reset?: bool): Date; + advance(year: number, month: number, day: number, reset?: boolean): Date; /** * @see advance * @param milliseconds Milliseconds to advance the date. **/ - advance(milliseconds: number, reset?: bool): Date; + advance(milliseconds: number, reset?: boolean): Date; /** * @see advance * @param set Advance the year/month/day of the date from a single object. **/ - advance(set: DateFields, reset?: bool): Date; + advance(set: DateFields, reset?: boolean): Date; /** * Sets the date to the beginning of the appropriate unit. @@ -4401,7 +4401,7 @@ interface Date { * new Date().getUTCOffset() -> "+0900" * new Date().getUTCOffset(true) -> "+09:00" **/ - getUTCOffset(iso?: bool): string; + getUTCOffset(iso?: boolean): string; /** * Gets the date's week (of the year). @@ -4445,9 +4445,9 @@ interface Date { * Date.create().is(-6106093200000) -> false * Date.create().is(new Date(1776, 6, 4)) -> false **/ - is(d: string, margin?: number): bool; - is(milliseconds: number, margin?: number): bool; - is(d: Date, margin?: number): bool; + is(d: string, margin?: number): boolean; + is(milliseconds: number, margin?: number): boolean; + is(d: Date, margin?: number): boolean; /** * Returns true if the date is after the . @@ -4460,9 +4460,9 @@ interface Date { * new Date().isAfter('tomorrow') -> false * new Date().isAfter('yesterday') -> true **/ - isAfter(d: string, margin?: number): bool; - isAfter(milliseconds: number, margin?: number): bool; - isAfter(d: Date, margin?: number): bool; + isAfter(d: string, margin?: number): boolean; + isAfter(milliseconds: number, margin?: number): boolean; + isAfter(d: Date, margin?: number): boolean; /** * Returns true if the date is before . @@ -4475,9 +4475,9 @@ interface Date { * new Date().isBefore('tomorrow') -> true * new Date().isBefore('yesterday') -> false **/ - isBefore(d: string, margin?: number): bool; - isBefore(milliseconds: number, margin?: number): bool; - isBefore(d: Date, margin?: number): bool; + isBefore(d: string, margin?: number): boolean; + isBefore(milliseconds: number, margin?: number): boolean; + isBefore(d: Date, margin?: number): boolean; /** * Returns true if the date falls between and . @@ -4490,9 +4490,9 @@ interface Date { * new Date().isBetween('yesterday', 'tomorrow') -> true * new Date().isBetween('last year', '2 years ago') -> false **/ - isBefore(start: string, end: string, margin?: number): bool; - isBefore(start: number, end: string, margin?: number): bool; - isBefore(start: Date, end: Date, margin?: number): bool; + isBefore(start: string, end: string, margin?: number): boolean; + isBefore(start: number, end: string, margin?: number): boolean; + isBefore(start: Date, end: Date, margin?: number): boolean; /** * Returns true if the date falls on that day. @@ -4519,18 +4519,18 @@ interface Date { * Date.create('yesterday').isWednesday() -> ? * Date.create('today').isWeekend() -> ? **/ - isToday(): bool; - isYesterday(): bool; - isTomorrow(): bool; - isWeekday(): bool; - isWeekend(): bool; - isSunday(): bool; - isMonday(): bool; - isTuesday(): bool; - isWednesday(): bool; - isThursday(): bool; - isFriday(): bool; - isSaturday(): bool; + isToday(): boolean; + isYesterday(): boolean; + isTomorrow(): boolean; + isWeekday(): boolean; + isWeekend(): boolean; + isSunday(): boolean; + isMonday(): boolean; + isTuesday(): boolean; + isWednesday(): boolean; + isThursday(): boolean; + isFriday(): boolean; + isSaturday(): boolean; /** * Returns true if the date is in the future. @@ -4540,7 +4540,7 @@ interface Date { * Date.create('next week').isFuture() -> true * Date.create('last week').isFuture() -> false **/ - isFuture(): bool; + isFuture(): boolean; /** * Returns true if the date is last week/month/year. @@ -4555,9 +4555,9 @@ interface Date { * Date.create('yesterday').isLastMonth() -> probably not... * Date.create('yesterday').isLastYear() -> even less likely... **/ - isLastWeek(): bool; - isLastMonth(): bool; - isLastYear(): bool; + isLastWeek(): boolean; + isLastMonth(): boolean; + isLastYear(): boolean; /** * Returns true if the date is a leap year. @@ -4566,7 +4566,7 @@ interface Date { * @example * Date.create('2000').isLeapYear() -> true **/ - isLeapYear(): bool; + isLeapYear(): boolean; /** * Returns true if the date is next week/month/year. @@ -4581,9 +4581,9 @@ interface Date { * Date.create('tomorrow').isNextMonth() -> probably not... * Date.create('tomorrow').isNextYear() -> even less likely... **/ - isNextWeek(): bool; - isNextMonth(): bool; - isNextYear(): bool; + isNextWeek(): boolean; + isNextMonth(): boolean; + isNextYear(): boolean; /** * Returns true if the date is in the past. @@ -4593,7 +4593,7 @@ interface Date { * Date.create('last week').isPast() -> true * Date.create('next week').isPast() -> false **/ - isPast(): bool; + isPast(): boolean; /** * Returns true if the date is this week/month/year. @@ -4608,9 +4608,9 @@ interface Date { * Date.create('tomorrow').isThisMonth() -> probably... * Date.create('tomorrow').isThisYear() -> signs point to yes... **/ - isThisWeek(): bool; - isThisMonth(): bool; - isThisYear(): bool; + isThisWeek(): boolean; + isThisMonth(): boolean; + isThisYear(): boolean; /** * Returns true if the date has no timezone offset. @@ -4621,7 +4621,7 @@ interface Date { * new Date().isUTC() -> true or false? * new Date().toUTC().isUTC() -> true **/ - isUTC(): bool; + isUTC(): boolean; /** * Returns true if the date is valid. @@ -4631,7 +4631,7 @@ interface Date { * new Date().isValid() -> true * new Date('flexor').isValid() -> false **/ - isValid(): bool; + isValid(): boolean; /** * @method iso() @@ -4690,9 +4690,9 @@ interface Date { * new Date().rewind(0, 2, 3) -> 2 months 3 days in the past * new Date().rewind(86400000) -> 1 day in the past **/ - rewind(ms: number, reset?: bool): Date; - rewind(year: number, month: number, day: number, reset?: bool): Date; - rewind(d: DateFields, reset?: bool): Date; + rewind(ms: number, reset?: boolean): Date; + rewind(year: number, month: number, day: number, reset?: boolean): Date; + rewind(d: DateFields, reset?: boolean): Date; /** * Sets the date object. @@ -4710,7 +4710,7 @@ interface Date { **/ set(ms: number): Date; set(year: number, month: number, day: number): Date; - set(d: DateFields, reset?: bool): Date; + set(d: DateFields, reset?: boolean): Date; /** * Sets the week (of the year). @@ -4887,7 +4887,7 @@ interface Date { * new Date().utc(true) * new Date().utc(false) **/ - utc(on?: bool): Date; + utc(on?: boolean): Date; } /** @@ -4908,12 +4908,12 @@ interface DateRange { * @example * Date.range('2003', '2005').contains(Date.create('2004')) -> true **/ - contains(d: Date): bool; + contains(d: Date): boolean; /** * @see contains **/ - contains(d: DateRange): bool; + contains(d: DateRange): boolean; /** * Return the duration of the DateRange in milliseconds. @@ -5021,7 +5021,7 @@ interface DateRange { * Date.range('2003', '2005').isValid() -> true * Date.range('2005', '2003').isValid() -> false **/ - isValid(): bool; + isValid(): boolean; /** * Returns a string representation of the DateRange. From cb822a64a350bc6354aac4fca1f8894b018dbc78 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 20:07:45 +0200 Subject: [PATCH 13/16] Sugar: commented out some code that produced "RangeError: Maximum call stack size exceeded" (TSC bug) --- sugar/sugar.d.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sugar/sugar.d.ts b/sugar/sugar.d.ts index c011dcc4b5..98a5c7705e 100644 --- a/sugar/sugar.d.ts +++ b/sugar/sugar.d.ts @@ -2375,8 +2375,9 @@ interface Array { * @example * [1,2,3,4,5,6,7].inGroups(3) -> [ [1,2,3], [4,5,6], [7] ] * [1,2,3,4,5,6,7].inGroups(3, 'none') -> [ [1,2,3], [4,5,6], [7,'none','none'] ] + * @note removed because of TSC bug https://typescript.codeplex.com/workitem/1143?FocusElement=CommentTextBox **/ - inGroups(num: number, padding?: T): T[][]; + //inGroups(num: number, padding?: T): T[][]; /** * Groups the array into arrays of elements each. @@ -2387,8 +2388,9 @@ interface Array { * @example * [1,2,3,4,5,6,7].inGroupsOf(4) -> [ [1,2,3,4], [5,6,7] ] * [1,2,3,4,5,6,7].inGroupsOf(4, 'none') -> [ [1,2,3,4], [5,6,7,'none'] ] + * @note removed because of TSC bug https://typescript.codeplex.com/workitem/1143?FocusElement=CommentTextBox **/ - inGroupsOf(num: number, padding?: T): T[][]; + //inGroupsOf(num: number, padding?: T): T[][]; /** * Adds to the array. @@ -2424,8 +2426,9 @@ interface Array { * @example * [1,2,3].indexOf(3) -> 1 * [1,2,3].indexOf(7) -> -1 + * @note Already defined in lib.d.ts. **/ - indexOf(search: T, fromIndex?: number): number; + //indexOf(search: T, fromIndex?: number): number; /** * Returns an array containing the elements all arrays have in common. @@ -2898,8 +2901,9 @@ interface Array { * @example * [1,2,3].zip([4,5,6]) -> [[1,2], [3,4], [5,6]] * ['Martin','John'].zip(['Luther','F.'], ['King','Kennedy']) -> [['Martin','Luther','King'], ['John','F.','Kennedy']] + * @note removed because of TSC bug https://typescript.codeplex.com/workitem/1143?FocusElement=CommentTextBox **/ - zip(...arrays: T[]): T[][]; + //zip(...arrays: T[]): T[][]; } interface ObjectStatic { From eb4eb383bcdd255e33cd1f9b563776d9c4b7f151 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 20:52:29 +0200 Subject: [PATCH 14/16] added possibility to provide extra TSC params in test runner (see Backgrid) --- _infrastructure/tests/runner.js | 8 ++++++-- _infrastructure/tests/runner.ts | 8 ++++++-- backgrid/backgrid-tests.ts.tscparams | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 backgrid/backgrid-tests.ts.tscparams diff --git a/_infrastructure/tests/runner.js b/_infrastructure/tests/runner.js index 190285474a..2999c057ff 100644 --- a/_infrastructure/tests/runner.js +++ b/_infrastructure/tests/runner.js @@ -583,7 +583,11 @@ var DefinitelyTyped; function Tsc() { } Tsc.run = function (tsfile, callback) { - Exec.exec('node ./_infrastructure/tests/typescript/tsc.js --module commonjs ', [tsfile], function (ExecResult) { + var command = 'node ./_infrastructure/tests/typescript/tsc.js --module commonjs '; + if (IO.fileExists(tsfile + '.tscparams')) { + command += '@' + tsfile + '.tscparams'; + } + Exec.exec(command, [tsfile], function (ExecResult) { callback(ExecResult); }); }; @@ -846,7 +850,7 @@ var DefinitelyTyped; SyntaxChecking.prototype.run = function (it, file, len, maxLen, callback) { var _this = this; - if (!endsWith(file.toUpperCase(), '-TESTS.TS') && file.indexOf('../_infrastructure') < 0) { + if (!endsWith(file.toUpperCase(), '-TESTS.TS') && endsWith(file.toUpperCase(), '.TS') && file.indexOf('../_infrastructure') < 0) { new Test(file).run(function (o) { var failed = false; diff --git a/_infrastructure/tests/runner.ts b/_infrastructure/tests/runner.ts index 3c8f162108..e7bf929265 100644 --- a/_infrastructure/tests/runner.ts +++ b/_infrastructure/tests/runner.ts @@ -28,7 +28,11 @@ module DefinitelyTyped { class Tsc { public static run(tsfile: string, callback: Function) { - Exec.exec('node ./_infrastructure/tests/typescript/tsc.js --module commonjs ', [tsfile], (ExecResult) => { + var command = 'node ./_infrastructure/tests/typescript/tsc.js --module commonjs '; + if (IO.fileExists(tsfile + '.tscparams')) { + command += '@' + tsfile + '.tscparams'; + } + Exec.exec(command, [tsfile], (ExecResult) => { callback(ExecResult); }); } @@ -292,7 +296,7 @@ module DefinitelyTyped { } private run(it, file, len, maxLen, callback: Function) { - if (!endsWith(file.toUpperCase(), '-TESTS.TS') && file.indexOf('../_infrastructure') < 0) { + if (!endsWith(file.toUpperCase(), '-TESTS.TS') && endsWith(file.toUpperCase(), '.TS') && file.indexOf('../_infrastructure') < 0) { new Test(file).run((o) => { var failed = false; diff --git a/backgrid/backgrid-tests.ts.tscparams b/backgrid/backgrid-tests.ts.tscparams new file mode 100644 index 0000000000..e85b4ac55c --- /dev/null +++ b/backgrid/backgrid-tests.ts.tscparams @@ -0,0 +1 @@ +--target ES5 \ No newline at end of file From ec369d1b74a78c527cfdf4ece2f634e7aaad49bf Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 21:04:18 +0200 Subject: [PATCH 15/16] jQueryUI: fixed empty string interpreted as null --- jqueryui/jqueryui-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index 120945550e..6ad4e34bc2 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1089,7 +1089,7 @@ function test_datepicker() { buttonImage: "images/calendar.gif", buttonImageOnly: true }); - $.datepicker.setDefaults($.datepicker.regional[""]); + $.datepicker.setDefaults($.datepicker.regional[""]); $("#datepicker").datepicker($.datepicker.regional["fr"]); $("#locale").change(function () { $("#datepicker").datepicker("option", @@ -1137,7 +1137,7 @@ function test_datepicker() { $(".selector").datepicker({ dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] }); $(".selector").datepicker({ dayNamesMin: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"] }); - $.datepicker.setDefaults($.datepicker.regional[""]); + $.datepicker.setDefaults($.datepicker.regional[""]); $(".selector").datepicker($.datepicker.regional["fr"]); } From cad8af00f517d75ad0f8843b76c8465fd83e0714 Mon Sep 17 00:00:00 2001 From: gstamac Date: Fri, 23 Aug 2013 21:20:41 +0200 Subject: [PATCH 16/16] Modernizr: changed ANSI to UTF-8 file encoding --- modernizr/modernizr-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modernizr/modernizr-tests.ts b/modernizr/modernizr-tests.ts index 012b924e6a..abb1752934 100644 --- a/modernizr/modernizr-tests.ts +++ b/modernizr/modernizr-tests.ts @@ -15,7 +15,7 @@ $(function () { if (Modernizr.webgl) { // loadAllWebGLScripts(); } else { - var msg = 'With a different browser you’ll get to see the WebGL experience here: get.webgl.org.'; + var msg = 'With a different browser you’ll get to see the WebGL experience here: get.webgl.org.'; document.getElementById('#notice').innerHTML = msg; }