the more tests are running again

This commit is contained in:
Danny Yoo 2011-09-15 14:19:21 -04:00
parent f2cc5b421f
commit 82a2f9e880
2 changed files with 40 additions and 44 deletions

View File

@ -30,7 +30,7 @@
(provide package
package-anonymous
;;package-anonymous
package-standalone-xhtml
get-inert-code
get-standalone-code
@ -77,14 +77,14 @@
(define (package-anonymous source-code
#:should-follow-children? should-follow?
#:output-port op)
(fprintf op "(function() {\n")
(package source-code
#:should-follow-children? should-follow?
#:output-port op)
(fprintf op " return invoke; })\n"))
;; (define (package-anonymous source-code
;; #:should-follow-children? should-follow?
;; #:output-port op)
;; (fprintf op "(function() {\n")
;; (package source-code
;; #:should-follow-children? should-follow?
;; #:output-port op)
;; (fprintf op " return invoke; })\n"))
@ -456,10 +456,10 @@ EOF
;; write-standalone-code: source output-port -> void
(define (write-standalone-code source-code op)
(package-anonymous source-code
#:should-follow-children? (lambda (src) #t)
#:output-port op)
(fprintf op "()(plt.runtime.currentMachine, function() {}, function() {}, {});\n"))
(package source-code
#:should-follow-children? (lambda (src) #t)
#:output-port op))

View File

@ -19,42 +19,38 @@
racket/path
racket/port))
(define first-run #t)
(define evaluate (make-evaluate
(lambda (program op)
(fprintf op "(function () {")
(displayln (get-runtime) op)
(newline op)
(fprintf op "var innerInvoke = ")
(package-anonymous program
#:should-follow-children? (lambda (src) #t)
#:output-port op)
(fprintf op "();\n")
(fprintf op #<<EOF
return (function(succ, fail, params) {
var machine = new plt.runtime.Machine();
var myParams = { currentDisplayer : function(MACHINE, v) {
params.currentDisplayer(v);
}
};
return innerInvoke(machine,
function() {
plt.runtime.invokeMains(machine, succ, fail);
},
function(MACHINE, e) {
return fail(e);
},
myParams);
});
});
EOF
)
)))
(when first-run
(display (get-runtime) op)
(set! first-run #f))
(display "return (function(succ, fail, params) {
var machine = new plt.runtime.Machine();
plt.runtime.currentMachine = machine;" op)
(package program
#:should-follow-children? (lambda (src) #t)
#:output-port op)
(display " machine.params.currentDisplayer = function(MACHINE, v) {
params.currentDisplayer(v);
};
plt.runtime.ready(function() {
plt.runtime.invokeMains(machine,
succ,
function(MACHINE, e) {
fail(e);
});
});
});
});" op))))
;; Flatten the paths out.