compressing the output of the compiler with google-closure. Fixing the typechecks on numbers
This commit is contained in:
parent
84f643cb3d
commit
c92f018aa8
|
@ -151,7 +151,7 @@
|
||||||
(let: ([test-string : String
|
(let: ([test-string : String
|
||||||
(case domain
|
(case domain
|
||||||
[(number)
|
[(number)
|
||||||
(format "(typeof(~a) === 'number')"
|
(format "(jsnums.isSchemeNumber(~a))"
|
||||||
operand-string)]
|
operand-string)]
|
||||||
[(string)
|
[(string)
|
||||||
(format "(typeof(~a) === 'string')"
|
(format "(typeof(~a) === 'string')"
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
(require racket/contract
|
(require racket/contract
|
||||||
racket/runtime-path
|
racket/runtime-path
|
||||||
racket/port
|
racket/port)
|
||||||
(planet dyoo/closure-compile:1:1))
|
|
||||||
|
|
||||||
|
|
||||||
(provide/contract [get-runtime (-> string?)])
|
(provide/contract [get-runtime (-> string?)])
|
||||||
|
@ -57,9 +57,8 @@
|
||||||
(port->string ip))))
|
(port->string ip))))
|
||||||
|
|
||||||
|
|
||||||
(define text (closure-compile
|
(define text (apply string-append
|
||||||
(apply string-append
|
(map path->string files)))
|
||||||
(map path->string files))))
|
|
||||||
|
|
||||||
|
|
||||||
(define (get-runtime)
|
(define (get-runtime)
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"quote-cdata.rkt"
|
"quote-cdata.rkt"
|
||||||
"../make.rkt"
|
"../make.rkt"
|
||||||
"../make-structs.rkt"
|
"../make-structs.rkt"
|
||||||
|
(planet dyoo/closure-compile:1:1)
|
||||||
(prefix-in runtime: "get-runtime.rkt")
|
(prefix-in runtime: "get-runtime.rkt")
|
||||||
(prefix-in racket: racket/base))
|
(prefix-in racket: racket/base))
|
||||||
|
|
||||||
|
@ -87,13 +88,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; get-runtime: -> string
|
|
||||||
(define (get-runtime)
|
|
||||||
(let ([buffer (open-output-string)])
|
|
||||||
(write-runtime buffer)
|
|
||||||
(get-output-string buffer)))
|
|
||||||
|
|
||||||
|
|
||||||
;; write-runtime: output-port -> void
|
;; write-runtime: output-port -> void
|
||||||
(define (write-runtime op)
|
(define (write-runtime op)
|
||||||
(let ([packaging-configuration
|
(let ([packaging-configuration
|
||||||
|
@ -121,6 +115,19 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(define *the-runtime*
|
||||||
|
(let ([buffer (open-output-string)])
|
||||||
|
(write-runtime buffer)
|
||||||
|
(closure-compile
|
||||||
|
(get-output-string buffer))))
|
||||||
|
|
||||||
|
|
||||||
|
;; get-runtime: -> string
|
||||||
|
(define (get-runtime)
|
||||||
|
*the-runtime*)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; *header* : string
|
;; *header* : string
|
||||||
|
@ -144,7 +151,8 @@ EOF
|
||||||
(package source-code
|
(package source-code
|
||||||
#:should-follow? (lambda (src p) #t)
|
#:should-follow? (lambda (src p) #t)
|
||||||
#:output-port buffer)
|
#:output-port buffer)
|
||||||
(get-output-string buffer)))
|
(closure-compile
|
||||||
|
(get-output-string buffer))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,7 +160,8 @@ EOF
|
||||||
(define (get-standalone-code source-code)
|
(define (get-standalone-code source-code)
|
||||||
(let ([buffer (open-output-string)])
|
(let ([buffer (open-output-string)])
|
||||||
(write-standalone-code source-code buffer)
|
(write-standalone-code source-code buffer)
|
||||||
(get-output-string buffer)))
|
(closure-compile
|
||||||
|
(get-output-string buffer))))
|
||||||
|
|
||||||
|
|
||||||
;; write-standalone-code: source output-port -> void
|
;; write-standalone-code: source output-port -> void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user