Merge pull request #8624 from loganfsmyth/misc-fixes
Verify 'sourceMap' option with hasOwnProperty, and verify string-typed 'version'
This commit is contained in:
commit
f6643d1804
@ -542,7 +542,7 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions {
|
|||||||
|
|
||||||
// "sourceMap" is just aliased to sourceMap, so copy it over as
|
// "sourceMap" is just aliased to sourceMap, so copy it over as
|
||||||
// we merge the options together.
|
// we merge the options together.
|
||||||
if (options.sourceMap) {
|
if (options.hasOwnProperty("sourceMap")) {
|
||||||
options.sourceMaps = options.sourceMap;
|
options.sourceMaps = options.sourceMap;
|
||||||
delete options.sourceMap;
|
delete options.sourceMap;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,6 +74,9 @@ export default declare((api, options, dirname) => {
|
|||||||
`but got ${JSON.stringify(corejsVersion)}.`,
|
`but got ${JSON.stringify(corejsVersion)}.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (typeof runtimeVersion !== "string") {
|
||||||
|
throw new Error(`The 'version' option must be a version string.`);
|
||||||
|
}
|
||||||
|
|
||||||
function has(obj, key) {
|
function has(obj, key) {
|
||||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user