From 9232e8b4058e2cd6235bfd230cb7b1ca684af1d7 Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Mon, 3 Sep 2018 18:44:10 -0700 Subject: [PATCH] Validate the type of the 'version' option for transform-runtime. --- packages/babel-plugin-transform-runtime/src/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/babel-plugin-transform-runtime/src/index.js b/packages/babel-plugin-transform-runtime/src/index.js index 88fe373cc0..7fb69f49d5 100644 --- a/packages/babel-plugin-transform-runtime/src/index.js +++ b/packages/babel-plugin-transform-runtime/src/index.js @@ -72,6 +72,9 @@ export default declare((api, options, dirname) => { `but got ${JSON.stringify(corejsVersion)}.`, ); } + if (typeof runtimeVersion !== "string") { + throw new Error(`The 'version' option must be a version string.`); + } function has(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key);