Add a fake `require` to go with the fake `exports`.
parent
fc68a25b21
commit
da95016228
|
@ -303,8 +303,11 @@ function tarCode(filesInOrder, files, write) {
|
|||
|
||||
// Wrap the following code in a self executing function and assign exports to
|
||||
// global. This is a first step towards removing symbols from the global scope.
|
||||
// exports is global and require is a function that returns global.
|
||||
function isolateJS(code) {
|
||||
return '(function (exports) {'+code+'\n}(function () {return this}()));\n';
|
||||
return '(function (exports, require) {'
|
||||
+ code + '\n'
|
||||
+ '}(function () {return this}(), (function (path) {return (function () {return this}())})));\n';
|
||||
}
|
||||
|
||||
function compressJS(values)
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
<link href="../static/custom/pad.css" rel="stylesheet">
|
||||
<script src="../static/custom/pad.js"></script>
|
||||
<style type="text/css" title="dynamicsyntax"></style>
|
||||
<script type="application/javascript">
|
||||
var require = (function (path) {return (function () {return this}())});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
// <![CDATA[
|
||||
var clientVars = {};
|
||||
|
||||
var require = (function (path) {return (function () {return this}())});
|
||||
|
||||
function createCookie(name,value,days)
|
||||
{
|
||||
if (days) {
|
||||
|
|
Loading…
Reference in New Issue