From cf15e825ee012cce09cff590510df7e0227b30d1 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 11 Jul 2016 09:30:58 -0700 Subject: [PATCH] Fix `this` in harness and improve gulpfile defaults --- Gulpfile.ts | 3 +++ src/harness/harness.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Gulpfile.ts b/Gulpfile.ts index 6f63fc23587..739fc0d3720 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -306,6 +306,9 @@ function needsUpdate(source: string | string[], dest: string | string[]): boolea function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): tsc.Settings { const copy: tsc.Settings = {}; + // TODO: Add --noImplicitThis --types --pretty when gulp-typescript adds support for them + copy.noImplicitAny = true; + copy.noEmitOnError = true; for (const key in base) { copy[key] = base[key]; } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 1977d95492c..985d00bcf63 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -127,7 +127,7 @@ namespace Utils { export function memoize(f: T): T { const cache: { [idx: string]: any } = {}; - return (function() { + return (function(this: any) { const key = Array.prototype.join.call(arguments); const cachedResult = cache[key]; if (cachedResult) {