diff --git a/whalesong/js-assembler/assemble.rkt b/whalesong/js-assembler/assemble.rkt index e4e779f..1dd73a8 100644 --- a/whalesong/js-assembler/assemble.rkt +++ b/whalesong/js-assembler/assemble.rkt @@ -39,6 +39,7 @@ (parameterize ([current-interned-symbol-table ((inst make-hash Symbol Symbol))] [current-interned-constant-closure-table ((inst make-hash Symbol MakeCompiledProcedure))]) (display "(function(M, success, fail, params) {\n" op) + (display "\"use strict\";\n" op) (display "var param;\n" op) (display "var RT = plt.runtime;\n" op) diff --git a/whalesong/js-assembler/package.rkt b/whalesong/js-assembler/package.rkt index 3edf552..47587a6 100644 --- a/whalesong/js-assembler/package.rkt +++ b/whalesong/js-assembler/package.rkt @@ -393,7 +393,7 @@ M.modules[~s] = (define start-time (current-inexact-milliseconds)) (cond [(UninterpretedSource? src) - (fprintf op "(function(M) { ~a }(plt.runtime.currentMachine));" (UninterpretedSource-datum src))] + (fprintf op "(function(M) {\n\"use strict\";\n ~a }(plt.runtime.currentMachine));" (UninterpretedSource-datum src))] [else (fprintf op "(") (on-source src stmts op)