From 7b1961880ada8178876628fb2ae35fb0f6dc7da7 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 09:32:40 +0900 Subject: [PATCH 01/28] switch to tsc 1.8.2 --- npm-shrinkwrap.json | 20 ++++++++++---------- package.json | 20 +++++++------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 84c9e4c7c..865b3b9bc 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,5 +1,5 @@ { - "name": "DefinitelyTyped", + "name": "definitely-typed", "version": "0.0.1", "dependencies": { "assertion-error": { @@ -13,14 +13,14 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" }, "bluebird": { - "version": "3.2.2", + "version": "3.3.1", "from": "bluebird@>=3.1.2 <4.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.2.2.tgz" + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.3.1.tgz" }, "brace-expansion": { - "version": "1.1.2", + "version": "1.1.3", "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz" + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" }, "concat-map": { "version": "0.0.1", @@ -89,9 +89,9 @@ "resolved": "https://registry.npmjs.org/isemail/-/isemail-2.1.0.tgz" }, "joi": { - "version": "7.2.3", + "version": "7.3.0", "from": "joi@>=7.2.2 <8.0.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-7.2.3.tgz" + "resolved": "https://registry.npmjs.org/joi/-/joi-7.3.0.tgz" }, "joi-assert": { "version": "0.0.3", @@ -196,9 +196,9 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.2.tgz" }, "typescript": { - "version": "1.7.5", - "from": "typescript@1.7.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.7.5.tgz" + "version": "1.8.2", + "from": "typescript@1.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.8.2.tgz" }, "wordwrap": { "version": "0.0.3", diff --git a/package.json b/package.json index 40a1b3e8a..2679936d0 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,15 @@ { "private": true, - "name": "DefinitelyTyped", + "name": "definitely-typed", "version": "0.0.1", - "homepage": "https://github.com/borisyankov/DefinitelyTyped", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped", "repository": { "type": "git", - "url": "https://github.com/borisyankov/DefinitelyTyped.git" + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git" }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/borisyankov/DefinitelyTyped/blob/master/LICENSE" - } - ], + "license": "MIT", "bugs": { - "url": "https://github.com/borisyankov/DefinitelyTyped/issues" + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" }, "engines": { "node": ">= 0.12.0" @@ -32,10 +27,9 @@ "refmap": "dt --dry --print-refmap", "help": "dt -h" }, - "dependencies": { - }, + "dependencies": {}, "devDependencies": { "definition-tester": "0.5.0", - "typescript": "1.7.5" + "typescript": "1.8.2" } } From 114405df927b66ba66e6721875d2f9fcf95386cf Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 10:54:07 +0900 Subject: [PATCH 02/28] fix xdate/xdate-tests.ts --- xdate/xdate-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdate/xdate-tests.ts b/xdate/xdate-tests.ts index dad175104..a395c141e 100644 --- a/xdate/xdate-tests.ts +++ b/xdate/xdate-tests.ts @@ -261,7 +261,7 @@ module XDate_Test //var xdate = new XDate(YEAR, MONTH, DATE, true); var xdate = new XDate(YEAR, MONTH, DATE); xdate.setUTCMode(true); - return xdate.getUTCMode() + return xdate.getUTCMode() && xdate.getFullYear() == YEAR && xdate.getMonth() == MONTH && xdate.getDate() == DATE && From f86d2a249f27d65627b3f87b70ba2609b612a0da Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 10:57:57 +0900 Subject: [PATCH 03/28] fix yfiles/yfiles-tests.ts --- yfiles/yfiles-tests.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yfiles/yfiles-tests.ts b/yfiles/yfiles-tests.ts index 0bc89557b..c19c823eb 100644 --- a/yfiles/yfiles-tests.ts +++ b/yfiles/yfiles-tests.ts @@ -139,6 +139,9 @@ module yfilesTest { } class MyNodeStyle extends yfiles.drawing.SimpleAbstractNodeStyle { + constructor() { + super(null); + } createVisual(node:yfiles.graph.INode, renderContext:yfiles.drawing.IRenderContext):yfiles.drawing.RectVisual { return new yfiles.drawing.RectVisual.FromRectangle(new yfiles.geometry.Rectangle(0, 0, 10, 10)); } From 756384cb7bb66e465137bd9aa0a770ed0a5e4ca6 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 10:59:51 +0900 Subject: [PATCH 04/28] fix vso-node-api/vso-node-api-tests.ts --- vso-node-api/vso-node-api-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vso-node-api/vso-node-api-tests.ts b/vso-node-api/vso-node-api-tests.ts index b2c188047..3e0d4f977 100644 --- a/vso-node-api/vso-node-api-tests.ts +++ b/vso-node-api/vso-node-api-tests.ts @@ -47,10 +47,10 @@ function test_apis() { var apis: basem.ClientApiBase[] = [buildapi, coreapi, filecontainerapi, galleryapi, gitapi, taskapi, agentapi, testapi, tfvcapi, witapi]; var qapis: basem.QClientApiBase[] = [qbuildapi, qcoreapi, qfilecontainerapi, qgalleryapi, qgitapi, qtaskapi, qagentapi, qtestapi, qtfvcapi, qwitapi]; - for(var api in apis) { + for(var api of apis) { console.log('API user agent name: ' + api.userAgent); } - for(var qapi in qapis) { + for(var qapi of qapis) { console.log('Q API user agent name: ' + qapi.api.userAgent); } } From beebddbc03276fff993d10c368c44c3f33023504 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:01:48 +0900 Subject: [PATCH 05/28] fix temp-fs/temp-fs-tests.ts --- temp-fs/temp-fs-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temp-fs/temp-fs-tests.ts b/temp-fs/temp-fs-tests.ts index 9d01e31f3..aee6e54d5 100644 --- a/temp-fs/temp-fs-tests.ts +++ b/temp-fs/temp-fs-tests.ts @@ -26,6 +26,6 @@ tempfs.mkdir({ if (err) { throw err; } console.log(dir.path, dir.recursive); - throw new Error('Since it is tracked, tempfs will remove it for you.'); + // throw new Error('Since it is tracked, tempfs will remove it for you.'); dir.unlink(); }); From 065d70e2b51ccfdd1b7d700e77d12e4c64240f3c Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:04:37 +0900 Subject: [PATCH 06/28] adhoc fix sequelize/sequelize-tests.ts --- sequelize/sequelize-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index b7a04761f..3800f2ae2 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -1300,7 +1300,7 @@ s.define( 'ProductWithSettersAndGetters2', { s.define( 'post', { title : Sequelize.STRING, authorId : { type : Sequelize.INTEGER, references : testModel, referencesKey : 'id' } -} ); +} as any /* TODO please remove `as any` */); s.define( 'post', { title : Sequelize.STRING, authorId : { type : Sequelize.INTEGER, references : { model : testModel, key : 'id' } } From acca43ecd7d9a408a468eb5f0ab67d0439320c73 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:18:12 +0900 Subject: [PATCH 07/28] adhoc fix sharepoint/SharePoint-tests.ts --- sharepoint/SharePoint-tests.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sharepoint/SharePoint-tests.ts b/sharepoint/SharePoint-tests.ts index 5b73493b3..271f74fed 100644 --- a/sharepoint/SharePoint-tests.ts +++ b/sharepoint/SharePoint-tests.ts @@ -995,7 +995,7 @@ module CSR { function GetCurrentLookupValue() { if (_dropdownElt == null) return ''; - return _dropdownElt.value == '0' || _dropdownElt.value == '' ? '' : _dropdownElt.value + ';#' + _dropdownElt.options[_dropdownElt.selectedIndex].text; + return _dropdownElt.value == '0' || _dropdownElt.value == '' ? '' : _dropdownElt.value + ';#' + (_dropdownElt.options[_dropdownElt.selectedIndex] as any /* TODO remove `as any` */).text; } function stripBraces(input: string): string { @@ -1093,12 +1093,12 @@ module CSR { var selected = false; while (_dropdownElt.options.length) { - _dropdownElt.options.remove(0); + (_dropdownElt.options as any /* TODO remove `as any` */).remove(0); } if (!_schema.Required) { var defaultOpt = new Option(Strings.STS.L_LookupFieldNoneOption, '0', selected, selected); - _dropdownElt.options.add(defaultOpt); + (_dropdownElt.options as any /* TODO remove `as any` */).add(defaultOpt); selected = _selectedValue == 0; } var isEmptyList = true; @@ -1122,7 +1122,7 @@ module CSR { selected = true; } var opt = new Option(text, id.toString(), isSelected, isSelected); - _dropdownElt.options.add(opt); + (_dropdownElt.options as any /* TODO remove `as any` */).add(opt); isEmptyList = false; } pendingLoads--; From 1e1e5ec5fa906c1b22648c228a116d855e00a154 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:20:17 +0900 Subject: [PATCH 08/28] fix restful.js/restful.js-tests.ts --- restful.js/restful.js-tests.ts | 52 ++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/restful.js/restful.js-tests.ts b/restful.js/restful.js-tests.ts index 80f3bd187..f2a5bff8b 100644 --- a/restful.js/restful.js-tests.ts +++ b/restful.js/restful.js-tests.ts @@ -144,33 +144,37 @@ resource.addRequestInterceptor((data: any, headers: any, method: string, url: st resource.addFullRequestInterceptor(function(params, headers, data, method, url) { //... - // all args had been modified - return { - params: params, - headers: headers, - data: data, - method: method, - url: url - }; - - // just return modified arguments - return { - headers: headers, - data: data - }; + if(Math.random() < 0.5) { + // all args had been modified + return { + params: params, + headers: headers, + data: data, + method: method, + url: url + }; + } else { + // just return modified arguments + return { + headers: headers, + data: data + }; + } }); resource.addFullResponseInterceptor(function(data, headers, method, url) { - // all args had been modified (method and url is read only) - return { - headers: headers, - data: data - }; - - // just return modified arguments - return { - headers: headers - }; + if(Math.random() < 0.5) { + // all args had been modified (method and url is read only) + return { + headers: headers, + data: data + }; + } else { + // just return modified arguments + return { + headers: headers + }; + } }); // From 91f7f2afa4714bcef92c68fa2c4f9fbd736bcd47 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:21:40 +0900 Subject: [PATCH 09/28] fix power-assert/power-assert-tests.ts --- power-assert/power-assert-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/power-assert/power-assert-tests.ts b/power-assert/power-assert-tests.ts index 465e73afc..e0fad7132 100644 --- a/power-assert/power-assert-tests.ts +++ b/power-assert/power-assert-tests.ts @@ -19,7 +19,7 @@ assert.throws(() => { }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (false) { + if (Math.random() < 0.5) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); @@ -44,7 +44,7 @@ customizedAssert1.throws(() => { }, undefined, "DODGED IT"); customizedAssert1.doesNotThrow(() => { - if (false) { + if (Math.random() < 0.5) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); From 713584a79d716c1c6ea7a09c7750986340fb628b Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:23:44 +0900 Subject: [PATCH 10/28] fix oclazyload/oclazyload-tests.ts --- oclazyload/oclazyload-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oclazyload/oclazyload-tests.ts b/oclazyload/oclazyload-tests.ts index d3d3d6b11..3a436b14a 100644 --- a/oclazyload/oclazyload-tests.ts +++ b/oclazyload/oclazyload-tests.ts @@ -41,7 +41,7 @@ angular.module('app').controller(['$ocLazyLoadProvider', function ($ocLazyLoad: 'bower_components/bootstrap/dist/js/bootstrap.js' ], cache: false, - kjdf: false + // kjdf: false }, { files: ['anotherModule.js'], From 87a47f0eddd6db3edeb22e1089bc1e5196589b72 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:24:55 +0900 Subject: [PATCH 11/28] fix node/node-*tests.ts --- node/node-0.11-tests.ts | 2 +- node/node-0.12-tests.ts | 2 +- node/node-tests.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/node/node-0.11-tests.ts b/node/node-0.11-tests.ts index 92ce84a9d..aacfdde54 100644 --- a/node/node-0.11-tests.ts +++ b/node/node-0.11-tests.ts @@ -24,7 +24,7 @@ assert.notStrictEqual(2, "2", "uses === comparator"); assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (false) { throw "a hammer at your face"; } + if (Math.random() < 0.5) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); //////////////////////////////////////////////////// diff --git a/node/node-0.12-tests.ts b/node/node-0.12-tests.ts index f955421d9..53eff3121 100644 --- a/node/node-0.12-tests.ts +++ b/node/node-0.12-tests.ts @@ -26,7 +26,7 @@ assert.notStrictEqual(2, "2", "uses === comparator"); assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (false) { throw "a hammer at your face"; } + if (Math.random() < 0.5) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); //////////////////////////////////////////////////// diff --git a/node/node-tests.ts b/node/node-tests.ts index 1d0a321c6..0bb663537 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -32,7 +32,7 @@ assert.notDeepStrictEqual({ x: { y: "3" } }, { x: { y: 3 } }, "uses === comparat assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (false) { throw "a hammer at your face"; } + if (Math.random() < 0.5) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); //////////////////////////////////////////////////// From 1314ebcfb0addae6ff97a25b82b33250427e4491 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:28:44 +0900 Subject: [PATCH 12/28] adhoc fix mithril/mithril-tests.ts --- mithril/mithril-tests.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mithril/mithril-tests.ts b/mithril/mithril-tests.ts index 56323c5dd..be5832a40 100644 --- a/mithril/mithril-tests.ts +++ b/mithril/mithril-tests.ts @@ -34,15 +34,15 @@ var todo = { view: function(ctrl: any) { return m("html", [ m("body", [ - m("input", {onchange: m.withAttr("value", ctrl.description), value: ctrl.description()}), - m("button", {onclick: ctrl.add}, "Add"), + m("input", {onchange: m.withAttr("value", ctrl.description), value: ctrl.description()} as any /* TODO remove `as any` */), + m("button", {onclick: ctrl.add} as any /* TODO remove `as any` */, "Add"), m("table", [ ctrl.list.map(function(task: any) { return m("tr", [ m("td", [ - m("input[type=checkbox]", {onclick: m.withAttr("checked", task.done), checked: task.done()}) + m("input[type=checkbox]", {onclick: m.withAttr("checked", task.done), checked: task.done()} as any /* TODO remove `as any` */) ]), - m("td", {style: {textDecoration: task.done() ? "line-through" : "none"}}, task.description()), + m("td", {style: {textDecoration: task.done() ? "line-through" : "none"}} as any /* TODO remove `as any` */, task.description()), ]) }) ]) From 5cbf18d2df7e544e818eae140213a233501e7654 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:29:53 +0900 Subject: [PATCH 13/28] fix meteor/meteor-tests.ts --- meteor/meteor-tests.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index bd3b7156c..35517dcc6 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -131,12 +131,15 @@ Meteor.methods({ /** * From Methods, Meteor.Error section */ -throw new Meteor.Error("logged-out", - "The user must be logged in to post a comment."); - -throw new Meteor.Error(403, - "The user must be logged in to post a comment."); +if (Math.random() < 0.5) { + throw new Meteor.Error("logged-out", + "The user must be logged in to post a comment."); +} +if (Math.random() < 0.5) { + throw new Meteor.Error(403, + "The user must be logged in to post a comment."); +} Meteor.call("methodName", function (error: Meteor.Error) { if (error.error === "logged-out") { From 41f24da0a56bb8ad35d98689d4f1ef22b35e487e Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:35:49 +0900 Subject: [PATCH 14/28] adhoc fix marionette/marionette-tests.ts --- marionette/marionette-tests.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/marionette/marionette-tests.ts b/marionette/marionette-tests.ts index 411ddc9b6..90b1d690e 100644 --- a/marionette/marionette-tests.ts +++ b/marionette/marionette-tests.ts @@ -114,6 +114,8 @@ module Marionette.Tests { behaviors: any; constructor(model: MyModel) { + super({ model: model }); + this.ui = { destroy: '.destroy' }; @@ -123,9 +125,6 @@ module Marionette.Tests { message: 'hello' } }; - - super({ model: model }); - } template() { @@ -136,8 +135,8 @@ module Marionette.Tests { class MainRegion extends Marionette.Region { constructor() { - this.el = '#main'; super(); + this.el = '#main'; } } @@ -147,13 +146,13 @@ module Marionette.Tests { options: any; constructor() { + super(); this.name = 'Adam'; this.options = { name: 'Foo' }; - super(); this.on("before:destroy", () => { console.log("before:destroy"); }); @@ -166,27 +165,28 @@ module Marionette.Tests { class MyRegion extends Marionette.Region { constructor() { - this.el = '#main-nav'; super(); + this.el = '#main-nav'; } } class MyJQueryRegion extends Marionette.Region { constructor() { - this.el = $('#main-nav'); super(); + this.el = $('#main-nav'); } } class MyHtmlElRegion extends Marionette.Region { constructor() { - this.el = document.querySelector("body"); super(); + this.el = document.querySelector("body"); } } class MyCollectionView extends Marionette.CollectionView { constructor() { + super(); this.childView = MyView; this.childEvents = { render: function () { @@ -208,8 +208,6 @@ module Marionette.Tests { this.childViewEventPrefix = "some:prefix"; - super(); - this.on('some:prefix:render', function () { }); From cd564b24dd2760941272c8b125bd8e6652b687da Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:57:26 +0900 Subject: [PATCH 15/28] update definition-tester version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2679936d0..b2eb7c02f 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ }, "dependencies": {}, "devDependencies": { - "definition-tester": "0.5.0", + "definition-tester": "0.5.1", "typescript": "1.8.2" } } From 8f548f2c1f70382e6e446ca6d3c0b5f437fd0810 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:58:22 +0900 Subject: [PATCH 16/28] Revert "fix temp-fs/temp-fs-tests.ts" This reverts commit beebddbc03276fff993d10c368c44c3f33023504. --- temp-fs/temp-fs-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temp-fs/temp-fs-tests.ts b/temp-fs/temp-fs-tests.ts index aee6e54d5..9d01e31f3 100644 --- a/temp-fs/temp-fs-tests.ts +++ b/temp-fs/temp-fs-tests.ts @@ -26,6 +26,6 @@ tempfs.mkdir({ if (err) { throw err; } console.log(dir.path, dir.recursive); - // throw new Error('Since it is tracked, tempfs will remove it for you.'); + throw new Error('Since it is tracked, tempfs will remove it for you.'); dir.unlink(); }); From ea26d20acf2e35d3a450d548c03bcc651ef6a64a Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:58:40 +0900 Subject: [PATCH 17/28] Revert "fix restful.js/restful.js-tests.ts" This reverts commit 1e1e5ec5fa906c1b22648c228a116d855e00a154. --- restful.js/restful.js-tests.ts | 52 ++++++++++++++++------------------ 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/restful.js/restful.js-tests.ts b/restful.js/restful.js-tests.ts index f2a5bff8b..80f3bd187 100644 --- a/restful.js/restful.js-tests.ts +++ b/restful.js/restful.js-tests.ts @@ -144,37 +144,33 @@ resource.addRequestInterceptor((data: any, headers: any, method: string, url: st resource.addFullRequestInterceptor(function(params, headers, data, method, url) { //... - if(Math.random() < 0.5) { - // all args had been modified - return { - params: params, - headers: headers, - data: data, - method: method, - url: url - }; - } else { - // just return modified arguments - return { - headers: headers, - data: data - }; - } + // all args had been modified + return { + params: params, + headers: headers, + data: data, + method: method, + url: url + }; + + // just return modified arguments + return { + headers: headers, + data: data + }; }); resource.addFullResponseInterceptor(function(data, headers, method, url) { - if(Math.random() < 0.5) { - // all args had been modified (method and url is read only) - return { - headers: headers, - data: data - }; - } else { - // just return modified arguments - return { - headers: headers - }; - } + // all args had been modified (method and url is read only) + return { + headers: headers, + data: data + }; + + // just return modified arguments + return { + headers: headers + }; }); // From 386562f1658bf9b513863aac636b8226eb2cb0e4 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:58:46 +0900 Subject: [PATCH 18/28] Revert "fix power-assert/power-assert-tests.ts" This reverts commit 91f7f2afa4714bcef92c68fa2c4f9fbd736bcd47. --- power-assert/power-assert-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/power-assert/power-assert-tests.ts b/power-assert/power-assert-tests.ts index e0fad7132..465e73afc 100644 --- a/power-assert/power-assert-tests.ts +++ b/power-assert/power-assert-tests.ts @@ -19,7 +19,7 @@ assert.throws(() => { }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (Math.random() < 0.5) { + if (false) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); @@ -44,7 +44,7 @@ customizedAssert1.throws(() => { }, undefined, "DODGED IT"); customizedAssert1.doesNotThrow(() => { - if (Math.random() < 0.5) { + if (false) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); From f273c4b9ca5acdacfa7f64050f261c7af6d0b781 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:58:54 +0900 Subject: [PATCH 19/28] Revert "fix node/node-*tests.ts" This reverts commit 87a47f0eddd6db3edeb22e1089bc1e5196589b72. --- node/node-0.11-tests.ts | 2 +- node/node-0.12-tests.ts | 2 +- node/node-tests.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/node/node-0.11-tests.ts b/node/node-0.11-tests.ts index aacfdde54..92ce84a9d 100644 --- a/node/node-0.11-tests.ts +++ b/node/node-0.11-tests.ts @@ -24,7 +24,7 @@ assert.notStrictEqual(2, "2", "uses === comparator"); assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (Math.random() < 0.5) { throw "a hammer at your face"; } + if (false) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); //////////////////////////////////////////////////// diff --git a/node/node-0.12-tests.ts b/node/node-0.12-tests.ts index 53eff3121..f955421d9 100644 --- a/node/node-0.12-tests.ts +++ b/node/node-0.12-tests.ts @@ -26,7 +26,7 @@ assert.notStrictEqual(2, "2", "uses === comparator"); assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (Math.random() < 0.5) { throw "a hammer at your face"; } + if (false) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); //////////////////////////////////////////////////// diff --git a/node/node-tests.ts b/node/node-tests.ts index 0bb663537..1d0a321c6 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -32,7 +32,7 @@ assert.notDeepStrictEqual({ x: { y: "3" } }, { x: { y: 3 } }, "uses === comparat assert.throws(() => { throw "a hammer at your face"; }, undefined, "DODGED IT"); assert.doesNotThrow(() => { - if (Math.random() < 0.5) { throw "a hammer at your face"; } + if (false) { throw "a hammer at your face"; } }, undefined, "What the...*crunch*"); //////////////////////////////////////////////////// From 2fdb6b74608180330d7bab29b48a19b8f3c9a972 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 11:59:05 +0900 Subject: [PATCH 20/28] Revert "fix meteor/meteor-tests.ts" This reverts commit 5cbf18d2df7e544e818eae140213a233501e7654. --- meteor/meteor-tests.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index 35517dcc6..bd3b7156c 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -131,15 +131,12 @@ Meteor.methods({ /** * From Methods, Meteor.Error section */ -if (Math.random() < 0.5) { - throw new Meteor.Error("logged-out", - "The user must be logged in to post a comment."); -} +throw new Meteor.Error("logged-out", + "The user must be logged in to post a comment."); + +throw new Meteor.Error(403, + "The user must be logged in to post a comment."); -if (Math.random() < 0.5) { - throw new Meteor.Error(403, - "The user must be logged in to post a comment."); -} Meteor.call("methodName", function (error: Meteor.Error) { if (error.error === "logged-out") { From 5ce1cfd5bfe1cc3151a72859e6e638f0f227fbe4 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 13:44:12 +0900 Subject: [PATCH 21/28] update npm-shrinkwrap.json... --- npm-shrinkwrap.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 865b3b9bc..27f9731d7 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -14,7 +14,7 @@ }, "bluebird": { "version": "3.3.1", - "from": "bluebird@>=3.1.2 <4.0.0", + "from": "bluebird@>=3.3.1 <4.0.0", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.3.1.tgz" }, "brace-expansion": { @@ -38,8 +38,8 @@ "resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.3.0.tgz" }, "definition-tester": { - "version": "0.5.0", - "from": "definition-tester@0.5.0" + "version": "0.5.1", + "from": "definition-tester@0.5.1" }, "findup-sync": { "version": "0.3.0", @@ -59,9 +59,9 @@ "resolved": "https://registry.npmjs.org/git-wrapper/-/git-wrapper-0.1.1.tgz" }, "glob": { - "version": "6.0.4", - "from": "glob@>=6.0.4 <7.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + "version": "7.0.0", + "from": "glob@>=7.0.0 <8.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.0.tgz" }, "hoek": { "version": "3.0.4", From 8a6d20411ab144aa29539d59db9c13e6405af616 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 15:17:16 +0900 Subject: [PATCH 22/28] adhoc fix giraffe/giraffe-tests.ts --- giraffe/giraffe-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/giraffe/giraffe-tests.ts b/giraffe/giraffe-tests.ts index 4cd6694da..ec6cb0c62 100644 --- a/giraffe/giraffe-tests.ts +++ b/giraffe/giraffe-tests.ts @@ -6,10 +6,10 @@ class User extends Giraffe.Model { class MainView extends Giraffe.View { constructor(options?) { + super(options); this.appEvents = { 'startup': 'app_onStartup' } - super(options); } app_onStartup() { @@ -20,10 +20,10 @@ class MainView extends Giraffe.View { class MyApp extends Giraffe.App { constructor() { + super(); this.routes= { '': 'home' } - super(); } home() { From eaa473ef943161b9557a327844fbcdd5edec1255 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 15:21:27 +0900 Subject: [PATCH 23/28] fix cryptojs/test/lib-typedarrays-tests.ts and cryptojs/all-tests.ts --- cryptojs/all-tests.ts.tscparams | 1 + cryptojs/test/lib-typedarrays-tests.ts.tscparams | 1 + 2 files changed, 2 insertions(+) create mode 100644 cryptojs/all-tests.ts.tscparams create mode 100644 cryptojs/test/lib-typedarrays-tests.ts.tscparams diff --git a/cryptojs/all-tests.ts.tscparams b/cryptojs/all-tests.ts.tscparams new file mode 100644 index 000000000..e5e9ee152 --- /dev/null +++ b/cryptojs/all-tests.ts.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny \ No newline at end of file diff --git a/cryptojs/test/lib-typedarrays-tests.ts.tscparams b/cryptojs/test/lib-typedarrays-tests.ts.tscparams new file mode 100644 index 000000000..e5e9ee152 --- /dev/null +++ b/cryptojs/test/lib-typedarrays-tests.ts.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny \ No newline at end of file From 73003b86eededc83430c0873164c9f56f8e2b978 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 15:23:57 +0900 Subject: [PATCH 24/28] adhoc fix backgrid/backgrid-tests.ts --- backgrid/backgrid-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backgrid/backgrid-tests.ts b/backgrid/backgrid-tests.ts index a29a4ae7e..f2a41a558 100644 --- a/backgrid/backgrid-tests.ts +++ b/backgrid/backgrid-tests.ts @@ -26,8 +26,8 @@ class TestModel extends Backbone.Model { class TestCollection extends Backbone.Collection { constructor(models?: any, options?: any) { - this.model = TestModel; super(models, options); + this.model = TestModel; } initialize() { @@ -46,6 +46,7 @@ class TestView extends Backbone.View { testCollection: TestCollection; constructor(viewOptions?: Backbone.ViewOptions) { + super(viewOptions); this.testCollection = new TestCollection(); this.gridView = new Backgrid.Grid({ columns: [new Backgrid.Column({name: "FirstName", cell: "string", label: "First Name"}), @@ -54,7 +55,6 @@ class TestView extends Backbone.View { collection:this.testCollection, }); - super(viewOptions); } From 6ecf96f40805db2430bfeec64760183687b33d40 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 15:28:43 +0900 Subject: [PATCH 25/28] adhoc fix backbone/backbone-with-lodash-tests.ts and backbone/backbone-tests.ts --- backbone/backbone-tests.ts | 2 +- backbone/backbone-with-lodash-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backbone/backbone-tests.ts b/backbone/backbone-tests.ts index 017546642..4f719f92b 100644 --- a/backbone/backbone-tests.ts +++ b/backbone/backbone-tests.ts @@ -29,11 +29,11 @@ class SettingDefaults extends Backbone.Model { } constructor(attributes?: any, options?: any) { + super(attributes, options); // error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. this.defaults = { name: "Joe" } // super has to come last - super(attributes, options); } // or set it like this diff --git a/backbone/backbone-with-lodash-tests.ts b/backbone/backbone-with-lodash-tests.ts index 0138b2603..001882ca0 100644 --- a/backbone/backbone-with-lodash-tests.ts +++ b/backbone/backbone-with-lodash-tests.ts @@ -30,11 +30,11 @@ class SettingDefaults extends Backbone.Model { } constructor(attributes?: any, options?: any) { + super(attributes, options); // TODO error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. this.defaults = { name: "Joe" } // super has to come last - super(attributes, options); } // or set it like this From 9d11eef8b75d8f9e7d3b5d5b5f10ec7245093b2a Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 15:30:45 +0900 Subject: [PATCH 26/28] adhoc fix backbone-associations/backbone-associations-tests.ts --- backbone-associations/backbone-associations-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backbone-associations/backbone-associations-tests.ts b/backbone-associations/backbone-associations-tests.ts index d25ddf17e..5f656b8f2 100644 --- a/backbone-associations/backbone-associations-tests.ts +++ b/backbone-associations/backbone-associations-tests.ts @@ -7,6 +7,7 @@ module Backbone.Associations.Tests { module OneToOne { class EmployeeWithManager extends Backbone.AssociatedModel { constructor(options?) { + super(options); this.relations = [ { type: Backbone.One, //nature of the relationship @@ -14,7 +15,6 @@ module Backbone.Associations.Tests { relatedModel: 'Employee' //AssociatedModel for attribute key } ]; - super(options); } defaults() { @@ -48,6 +48,7 @@ module Backbone.Associations.Tests { class Project extends Backbone.AssociatedModel { constructor(options?) { + super(options); this.relations = [ { type: Backbone.Many, //nature of the relation @@ -56,7 +57,6 @@ module Backbone.Associations.Tests { relatedModel: Location //Optional } ]; - super(options); } defaults() { From f504ccb74350e68188274d7d6b036f69fb1338e9 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 15:33:00 +0900 Subject: [PATCH 27/28] fix baconjs/baconjs-tests.ts --- baconjs/baconjs-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/baconjs/baconjs-tests.ts b/baconjs/baconjs-tests.ts index 9557e37cd..ab5b67180 100644 --- a/baconjs/baconjs-tests.ts +++ b/baconjs/baconjs-tests.ts @@ -75,7 +75,7 @@ function CreatingStreams() { var stream = Bacon.fromBinder(sink => { sink("first value"); sink([new Bacon.Next("2nd"), new Bacon.Next("3rd")]); - sink(new Bacon.Next(() => { + sink(new Bacon.Next((): string => { return "This one will be evaluated lazily" })); sink(new Bacon.Error("oops, an error")); @@ -88,7 +88,7 @@ function CreatingStreams() { } new Bacon.Next("value"); - new Bacon.Next(() => "value"); + new Bacon.Next((): string => "value"); } function CommonMethodsInEventStreamsAndProperties() { @@ -296,7 +296,7 @@ function CombiningMultipleStreamsAndProperties() { function $Event() { new Bacon.Next("value"); - new Bacon.Next(() => "value"); + new Bacon.Next((): string => "value"); } function Errors() { From ec2a8c9cc844a76ae66808bb9c709c2fc29aa250 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Feb 2016 15:33:32 +0900 Subject: [PATCH 28/28] adhoc fix alt/alt-tests.ts --- alt/alt-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alt/alt-tests.ts b/alt/alt-tests.ts index 1941b4071..fad079b02 100644 --- a/alt/alt-tests.ts +++ b/alt/alt-tests.ts @@ -41,8 +41,8 @@ class AbstractStoreModel implements AltJS.StoreModel { class GenerateActionsClass extends AbstractActions { constructor(config:AltJS.Alt) { - this.generateActions("notifyTest"); super(config); + this.generateActions("notifyTest"); } }