speed-highlight / core

A lightweight syntax highlighter written in JavaScript
https://speed-highlight.github.io/core/examples/
Creative Commons Zero v1.0 Universal
268 stars 15 forks source link

[BUG] Deno: Cannot access 'theme' before initialization #24

Closed derheap closed 2 years ago

derheap commented 2 years ago

Information

Description

Running the Deno example fails with an error:

error: Uncaught (in promise) ReferenceError: Cannot access 'theme' before initialization
        let res = '', theme = await theme;
                              ^
    at highlightText (file:///Users/tobias/code/speed-highlight--core/src/term.js:10:24)
    at printHighlight (file:///Users/tobias/code/speed-highlight--core/src/term.js:17:67)
    at file:///Users/tobias/code/speed-highlight--core/examples/deno.js:14:1

Example

$ git clone https://github.com/speed-highlight/core.git
$ cd core
$ deno run --allow-read examples/deno.js

Expected behavior

Just print the highlighted code.

matubu commented 2 years ago

thanks for reporting, it should be fix now

derheap commented 2 years ago

Thanks for fixing. It works now!