Skip to content

Commit

Permalink
make get-environment-variables and get-environment-variable to wo…
Browse files Browse the repository at this point in the history
…rk in the browser #284
  • Loading branch information
jcubic committed Jan 22, 2024
1 parent fa4a4dd commit ef65875
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## 1.0.0-beta.19
### Breaking
* `get-environment-variables` and `get-environment-variable` returns nil and undefined in the browser
### Features
* add `vector-for-each` and `vector-copy!` function from R7RS
* add `string-for-each`, `string-downcase`, and `string-upcase` from R7RS
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</h1>

[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/lips_lang)](https://twitter.com/lips_lang)
[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.18-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.18.1-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
![1.0.0 Complete](https://img.shields.io/github/milestones/progress-percent/jcubic/lips/1?label=1.0.0%20Complete)
[![Build and test](https://github.com/jcubic/lips/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/lips/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&7951433cc9ff158c3701ffea07e0f004)](https://coveralls.io/github/jcubic/lips?branch=devel)
Expand Down
4 changes: 2 additions & 2 deletions dist/std.min.scm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions dist/std.scm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/std.xcb
Binary file not shown.
13 changes: 7 additions & 6 deletions lib/R7RS.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1790,19 +1790,20 @@
(define (get-environment-variables)
"(get-environment-variables)

Returns all process environment variables as an alist. This function throws exception
when called in browser."
Returns all process environment variables as an alist. This function returns
an empty list when called in the browser."
(if (eq? self window)
(throw "get-environment-variables: Node.js only function")
nil
(object->alist process.env)))

;; -----------------------------------------------------------------------------
(define (get-environment-variable name)
"(get-environment-variable name)

Returns given environment variable. This function throws exception
when called in browser."
(. process.env name))
Returns given environment variable. This function returns undefined
when called in the browser."
(if (not (eq? self window))
(. process.env name)))

;; -----------------------------------------------------------------------------
(define (current-second)
Expand Down

0 comments on commit ef65875

Please sign in to comment.