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

View File

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