putting use strict in generated code to keep me honest.

This commit is contained in:
Danny Yoo 2013-03-06 16:50:03 -07:00
parent 07b393f693
commit 73a6967942
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

@ -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)