mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Turn off LM scuttling feature for dev builds (#17771)
This commit is contained in:
parent
3678894df2
commit
afed985b48
@ -73,9 +73,17 @@ async function defineAndRunBuildTasks() {
|
||||
version,
|
||||
} = await parseArgv();
|
||||
|
||||
// scuttle on production/tests environment only
|
||||
const shouldScuttle = ['dist', 'prod', 'test'].includes(entryTask);
|
||||
|
||||
console.log(
|
||||
`Building lavamoat runtime file`,
|
||||
`(scuttling is ${shouldScuttle ? 'on' : 'off'})`,
|
||||
);
|
||||
|
||||
// build lavamoat runtime file
|
||||
await lavapack.buildRuntime({
|
||||
scuttleGlobalThis: true,
|
||||
scuttleGlobalThis: applyLavaMoat && shouldScuttle,
|
||||
scuttleGlobalThisExceptions: [
|
||||
// globals used by different mm deps outside of lm compartment
|
||||
'toString',
|
||||
|
@ -163,7 +163,7 @@ function wrapAgainstScuttling(content, bag = {}) {
|
||||
const proxy = new Proxy(bag, {
|
||||
set: function set(target, prop, value) {
|
||||
if (bag.hasOwnProperty(prop) || prop.startsWith('on')) {
|
||||
return bag[prop] = global[prop] = value;
|
||||
return (bag[prop] = global[prop] = value) || true;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user