diff --git a/.flowconfig b/.flowconfig index 8ba353abdd3..69a5ab22993 100644 --- a/.flowconfig +++ b/.flowconfig @@ -10,8 +10,5 @@ .*/test/unit/style-spec/fixture/invalidjson.input.json .*/test/integration/render-tests/.* -[options] -unsafe.enable_getters_and_setters=true - [version] -0.61.0 +0.62.0 diff --git a/package.json b/package.json index fb9235b35cb..29640c6f31d 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "eslint-plugin-node": "^5.1.1", "eslint-plugin-react": "^7.3.0", "execcommand-copy": "^1.1.0", - "flow-bin": "^0.61.0", + "flow-bin": "^0.62.0", "flow-coverage-report": "^0.3.0", "flow-remove-types": "^1.0.4", "github-slugger": "^1.1.1", diff --git a/src/source/canvas_source.js b/src/source/canvas_source.js index 1814610cea7..7f36c56df15 100644 --- a/src/source/canvas_source.js +++ b/src/source/canvas_source.js @@ -73,7 +73,11 @@ class CanvasSource extends ImageSource { this.canvas = this.canvas || window.document.getElementById(this.options.canvas); this.width = this.canvas.width; this.height = this.canvas.height; - if (this._hasInvalidDimensions()) return this.fire('error', new Error('Canvas dimensions cannot be less than or equal to zero.')); + + if (this._hasInvalidDimensions()) { + this.fire('error', new Error('Canvas dimensions cannot be less than or equal to zero.')); + return; + } this.play = function() { this._playing = true; diff --git a/src/source/source.js b/src/source/source.js index dd6c02ece60..730181a9f56 100644 --- a/src/source/source.js +++ b/src/source/source.js @@ -40,7 +40,9 @@ export interface Source { * implementation for this Source type by calling `self.registerWorkerSource(workerSource: WorkerSource)`. * @private */ - static workerSourceURL?: URL; + // Static interface properties are not supported in flow as of 0.62.0. + // https://github.com/facebook/flow/issues/5590 + // static workerSourceURL?: URL; +type: string; id: string; diff --git a/src/style-spec/expression/expression.js b/src/style-spec/expression/expression.js index 6a466cff9fd..25e1dc2c634 100644 --- a/src/style-spec/expression/expression.js +++ b/src/style-spec/expression/expression.js @@ -2,13 +2,15 @@ import type {Type} from './types'; import type {Value} from './values'; -import type ParsingContext from './parsing_context'; import type EvaluationContext from './evaluation_context'; export interface Expression { +type: Type; - static parse(args: Array, context: ParsingContext): ?Expression; + // Static interface properties are not supported in flow as of 0.62.0. + // https://github.com/facebook/flow/issues/5590 + // static parse(args: Array, context: ParsingContext): ?Expression; + evaluate(ctx: EvaluationContext): any; eachChild(fn: Expression => void): void; diff --git a/src/style-spec/expression/parsing_context.js b/src/style-spec/expression/parsing_context.js index 7dac65e7873..a4a85ca94f6 100644 --- a/src/style-spec/expression/parsing_context.js +++ b/src/style-spec/expression/parsing_context.js @@ -79,7 +79,8 @@ class ParsingContext { const Expr = context.definitions[op]; if (Expr) { - let parsed = Expr.parse(expr, context); + // https://github.com/facebook/flow/issues/5590 + let parsed: ?Expression = (Expr: any).parse(expr, context); if (!parsed) return null; if (context.expectedType) { diff --git a/yarn.lock b/yarn.lock index ea4679c675b..33addee50b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4279,9 +4279,9 @@ flatten@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" -flow-bin@^0.61.0: - version "0.61.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.61.0.tgz#d0473a8c35dbbf4de573823f4932124397d32d35" +flow-bin@^0.62.0: + version "0.62.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.62.0.tgz#14bca669a6e3f95c0bc0c2d1eb55ec4e98cb1d83" flow-coverage-report@^0.3.0: version "0.3.0"