An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 9.0% on proxy.golang.org

proxy.golang.org : github.com/xtaci/otto

Package otto is a JavaScript parser and interpreter written natively in Go. http://godoc.org/github.com/robertkrimen/otto Embedding a Go function in JavaScript: You can run (Go) JavaScript from the commandline with: http://github.com/robertkrimen/otto/tree/master/otto Run JavaScript by entering some source on stdin or by giving otto a filename: Optionally include the JavaScript utility-belt library, underscore, with this import: For more information: http://github.com/robertkrimen/otto/tree/master/underscore Caveat Emptor Go translates JavaScript-style regular expressions into something that is "regexp" package compatible. Unfortunately, JavaScript has positive lookahead, negative lookahead, and backreferencing, all of which are not supported by Go's RE2-like engine: https://code.google.com/p/re2/wiki/Syntax A brief discussion of these limitations: "Regexp (?!re)" https://groups.google.com/forum/?fromgroups=#%21topic/golang-nuts/7qgSDWPIh_E More information about RE2: https://code.google.com/p/re2/ JavaScript considers a vertical tab (\000B <VT>) to be part of the whitespace class (\s), while RE2 does not. If you want to stop long running executions (like third-party code), you can use the interrupt channel to do this: Where is setTimeout/setInterval? These timing functions are not actually part of the ECMA-262 specification. Typically, they belong to the `windows` object (in the browser). It would not be difficult to provide something like these via Go, but you probably want to wrap otto in an event loop in that case. Here is some discussion of the problem: * http://book.mixu.net/node/ch2.html * http://en.wikipedia.org/wiki/Reentrancy_%28computing%29 * http://aaroncrane.co.uk/2009/02/perl_safe_signals/

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/xtaci/otto
License: MIT
Latest release: about 11 years ago
First release: about 11 years ago
Namespace: github.com/xtaci
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 1 month ago

    Loading...
    Readme
    Loading...