diff --git a/js-assembler/mini-runtime.js b/js-assembler/mini-runtime.js index 5b358f6..c8203cf 100644 --- a/js-assembler/mini-runtime.js +++ b/js-assembler/mini-runtime.js @@ -313,7 +313,8 @@ if (typeof(window.console) !== 'undefined' && typeof(console.log) === 'function') { console.log(MACHINE); - console.log(e); + if (e.stack) { console.log(e.stack); } + else { console.log(e); } } throw e; }; @@ -1292,6 +1293,7 @@ exports['testArgument'] = testArgument; exports['testArity'] = testArity; + exports['raise'] = raise; exports['raiseContextExpectedValuesError'] = raiseContextExpectedValuesError; exports['raiseArityMismatchError'] = raiseArityMismatchError; diff --git a/lang/kernel.rkt b/lang/kernel.rkt index c74aa7c..a6766d8 100644 --- a/lang/kernel.rkt +++ b/lang/kernel.rkt @@ -142,250 +142,258 @@ ;; Many of these should be pushed upward rather than stubbed, so that ;; Racket's compiler can optimize these. -(provide-stub-function write - display - displayln - newline - current-print - current-continuation-marks - continuation-mark-set? - continuation-mark-set->list - for-each +(provide-stub-function - make-struct-type - make-struct-field-accessor - make-struct-field-mutator - struct-type? - struct-constructor-procedure? - struct-predicate-procedure? - struct-accessor-procedure? - struct-mutator-procedure? - procedure-arity - procedure-arity-includes? - make-arity-at-least - arity-at-least? - arity-at-least-value - apply - values - call-with-values - compose - current-inexact-milliseconds - current-seconds - void - random - sleep - (identity -identity) - raise - error + write + display + newline - make-exn - make-exn:fail - make-exn:fail:contract - make-exn:fail:contract:arity - make-exn:fail:contract:variable - make-exn:fail:contract:divide-by-zero + #;displayln - exn-message - exn-continuation-marks +;; current-print +;; current-continuation-marks - exn? - exn:fail? - exn:fail:contract? - exn:fail:contract:arity? - exn:fail:contract:variable? - exn:fail:contract:divide-by-zero? - abs - quotient - remainder - modulo - max - min - gcd - lcm - floor - ceiling - round - truncate - numerator - denominator - expt - exp - log - sin - cos - tan - asin - acos - atan +;; continuation-mark-set? +;; continuation-mark-set->list - sqrt - integer-sqrt - make-rectangular - make-polar - real-part - imag-part - angle - magnitude - inexact->exact - exact->inexact - number->string - string->number - procedure? - pair? - (undefined? -undefined?) - immutable? - void? - symbol? - string? - char? - boolean? - vector? - struct? - eof-object? - bytes? - byte? - number? - complex? - real? - rational? - integer? - exact? - inexact? - odd? - even? - zero? - positive? - negative? - box? - hash? - eqv? - equal? - caar - cadr - cdar - cddr - caaar - caadr - cadar - cdaar - cdadr - cddar - caddr - cdddr - cadddr - length - list? - list* - list-ref - list-tail - append - reverse - map - andmap - ormap - memq - memv - member - memf - assq - assv - assoc - remove - filter - foldl - foldr - sort - build-list - box - box-immutable - unbox - set-box! - make-hash - make-hasheq - hash-set! - hash-ref - hash-remove! - hash-map - hash-for-each - make-string - string - string-length - string-ref - string=? - string-ci=? - string? - string<=? - string>=? - string-ci? - string-ci<=? - string-ci>=? - substring - string-append - string->list - list->string - string-copy - string->symbol - symbol->string - format - printf - build-string - string->immutable-string - string-set! - string-fill! - make-bytes - bytes - bytes->immutable-bytes - bytes-length - bytes-ref - bytes-set! - subbytes - bytes-copy - bytes-fill! - bytes-append - bytes->list - list->bytes - bytes=? - bytes? - make-vector - vector - vector-length - vector-ref - vector-set! - vector->list - list->vector - build-vector - char=? - char? - char<=? - char>=? - char-ci=? - char-ci? - char-ci<=? - char-ci>=? - char-alphabetic? - char-numeric? - char-whitespace? - char-upper-case? - char-lower-case? - char->integer - integer->char - char-upcase - char-downcase +;; make-struct-type +;; make-struct-field-accessor +;; make-struct-field-mutator +;; struct-type? +;; struct-constructor-procedure? +;; struct-predicate-procedure? +;; struct-accessor-procedure? +;; struct-mutator-procedure? +;; procedure-arity +;; procedure-arity-includes? +;; make-arity-at-least +;; arity-at-least? +;; arity-at-least-value +;; apply +;; values +;; call-with-values +;; compose +;; current-inexact-milliseconds +;; current-seconds +;; void +;; random +;; sleep +;; (identity -identity) +;; raise +;; error - - call-with-current-continuation - call/cc - call-with-continuation-prompt - abort-current-continuation - default-continuation-prompt-tag - make-continuation-prompt-tag - continuation-prompt-tag? +;; make-exn +;; make-exn:fail +;; make-exn:fail:contract +;; make-exn:fail:contract:arity +;; make-exn:fail:contract:variable +;; make-exn:fail:contract:divide-by-zero - make-reader-graph - make-placeholder - placeholder-set!) +;; exn-message +;; exn-continuation-marks + +;; exn? +;; exn:fail? +;; exn:fail:contract? +;; exn:fail:contract:arity? +;; exn:fail:contract:variable? +;; exn:fail:contract:divide-by-zero? +;; abs +;; quotient +;; remainder +;; modulo +;; max +;; min +;; gcd +;; lcm +;; floor +;; ceiling +;; round +;; truncate +;; numerator +;; denominator +;; expt +;; exp +;; log +;; sin +;; cos +;; tan +;; asin +;; acos +;; atan + +;; sqrt +;; integer-sqrt +;; make-rectangular +;; make-polar +;; real-part +;; imag-part +;; angle +;; magnitude +;; inexact->exact +;; exact->inexact +;; number->string +;; string->number +;; procedure? +;; pair? +;; (undefined? -undefined?) +;; immutable? +;; void? +;; symbol? +;; string? +;; char? +;; boolean? +;; vector? +;; struct? +;; eof-object? +;; bytes? +;; byte? +;; number? +;; complex? +;; real? +;; rational? +;; integer? +;; exact? +;; inexact? +;; odd? +;; even? +;; zero? +;; positive? +;; negative? +;; box? +;; hash? +;; eqv? +;; equal? +;; caar +;; cadr +;; cdar +;; cddr +;; caaar +;; caadr +;; cadar +;; cdaar +;; cdadr +;; cddar +;; caddr +;; cdddr +;; cadddr +;; length +;; list? +;; list* +;; list-ref +;; list-tail +;; append +;; reverse +;; for-each +;; map +;; andmap +;; ormap +;; memq +;; memv +;; member +;; memf +;; assq +;; assv +;; assoc +;; remove +;; filter +;; foldl +;; foldr +;; sort +;; build-list +;; box +;; box-immutable +;; unbox +;; set-box! +;; make-hash +;; make-hasheq +;; hash-set! +;; hash-ref +;; hash-remove! +;; hash-map +;; hash-for-each +;; make-string +;; string +;; string-length +;; string-ref +;; string=? +;; string-ci=? +;; string? +;; string<=? +;; string>=? +;; string-ci? +;; string-ci<=? +;; string-ci>=? +;; substring +;; string-append +;; string->list +;; list->string +;; string-copy +;; string->symbol +;; symbol->string +;; format +;; printf +;; build-string +;; string->immutable-string +;; string-set! +;; string-fill! +;; make-bytes +;; bytes +;; bytes->immutable-bytes +;; bytes-length +;; bytes-ref +;; bytes-set! +;; subbytes +;; bytes-copy +;; bytes-fill! +;; bytes-append +;; bytes->list +;; list->bytes +;; bytes=? +;; bytes? +;; make-vector +;; vector +;; vector-length +;; vector-ref +;; vector-set! +;; vector->list +;; list->vector +;; build-vector +;; char=? +;; char? +;; char<=? +;; char>=? +;; char-ci=? +;; char-ci? +;; char-ci<=? +;; char-ci>=? +;; char-alphabetic? +;; char-numeric? +;; char-whitespace? +;; char-upper-case? +;; char-lower-case? +;; char->integer +;; integer->char +;; char-upcase +;; char-downcase + + +;; call-with-current-continuation +;; call/cc +;; call-with-continuation-prompt +;; abort-current-continuation +;; default-continuation-prompt-tag +;; make-continuation-prompt-tag +;; continuation-prompt-tag? + +;; make-reader-graph +;; make-placeholder +;; placeholder-set! + + + )