Add static Math methods to plugin-transform-runtime (#8616)
* Add static Math methods to plugin-transform-runtime * Remove methods which are not part of TC39 standard * Use semver to conditionally include Math module
This commit is contained in:
committed by
Logan Smyth
parent
4beb977f15
commit
262787bd92
@@ -4,7 +4,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { addDefault, isModule } from "@babel/helper-module-imports";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
import definitions from "./definitions";
|
||||
import getDefinitions from "./definitions";
|
||||
|
||||
function resolveAbsoluteRuntime(moduleName: string, dirname: string) {
|
||||
try {
|
||||
@@ -41,6 +41,8 @@ export default declare((api, options, dirname) => {
|
||||
absoluteRuntime = false,
|
||||
} = options;
|
||||
|
||||
const definitions = getDefinitions(runtimeVersion);
|
||||
|
||||
if (typeof useRuntimeRegenerator !== "boolean") {
|
||||
throw new Error(
|
||||
"The 'regenerator' option must be undefined, or a boolean.",
|
||||
|
||||
Reference in New Issue
Block a user