mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-17 14:29:48 +02:00
#2219 Frezing object to protect the prototype
This commit is contained in:
12
src/utils.js
12
src/utils.js
@@ -77,8 +77,20 @@ export const detectInit = function (text, cnf) {
|
||||
log.debug('sanitize deleting prototype option', args[key]);
|
||||
delete args[argKey][key];
|
||||
}
|
||||
|
||||
if (key.indexOf('proto') >= 0) {
|
||||
log.debug('sanitize deleting prototype option', args[key]);
|
||||
delete args[argKey][key];
|
||||
}
|
||||
|
||||
if (key.indexOf('constr') >= 0) {
|
||||
log.debug('sanitize deleting prototype option', args[key]);
|
||||
delete args[argKey][key];
|
||||
}
|
||||
});
|
||||
});
|
||||
Object.freeze(Object.prototype);
|
||||
Object.freeze(Object);
|
||||
results = assignWithDepth(results, [...args]);
|
||||
} else {
|
||||
results = inits.args;
|
||||
|
Reference in New Issue
Block a user