Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Remove __proto__ parsing from browser build scripts

Nathan Houle993d1ebe03a9
diff --git a/support/compile.js b/support/compile.js
index bea017ab..cd99fc47 100644
--- a/support/compile.js
+++ b/support/compile.js
@@ -33,7 +33,7 @@ args.forEach(function(file){
*/
function parse(js) {
- return parseRequires(parseInheritance(js));
+ return parseRequires(js);
}
/**
@@ -52,20 +52,6 @@ function parseRequires(js) {
.replace(/require\('fs'\)/g , "require('browser/fs')");
}
-/**
- * Parse __proto__.
- */
-
-function parseInheritance(js) {
- return js
- .replace(/^ *(\w+)\.prototype\.__proto__ * = *(\w+)\.prototype *;?/gm, function(_, child, parent){
- return 'function F(){};\n'
- + 'F.prototype = ' + parent + '.prototype;\n'
- + child + '.prototype = new F;\n'
- + child + '.prototype.constructor = '+ child + ';\n';
- });
-}
-
/**
* Compile the files.
*/