summary refs log tree commit diff stats
path: root/lib/js
Commit message (Collapse)AuthorAgeFilesLines
* fixes #4299 #12492 #10849; lambda lifting for JS backend (#23484)ringabout2024-04-111-1/+1
| | | | | | | | fixes #4299 fixes #12492 fixes #10849 It binds `function` with `env`: `function.bind(:env)` to ease codegen for now
* fix BigInt conversion, xOffset/yOffset to int from int64 (#23404)Chancy K2024-03-151-1/+1
| | | | | Problem described here: https://github.com/karaxnim/karax/issues/284 Co-authored-by: Chancy Kennedy <chancy@conciergecloset.com>
* Deprecate asm stmt for js target (#23149)ASVIEST2024-01-022-3/+3
| | | | | | | | | | | | | | | | | | | | | | | why ? - We already have an emit that does the same thing - The name asm itself is a bit confusing, you might think it's an alias for asm.js or something else. - The asm keyword is used differently on different compiler targets (it makes it inexpressive). - Does anyone (other than some compiler libraries) use asm instead of emit ? If yes, it's a bit strange to use asm somewhere and emit somewhere. By making the asm keyword for js target deprecated, there would be even less use of the asm keyword for js target, reducing the amount of confusion. - New users might accidentally use a non-universal approach via the asm keyword instead of emit, and then when they learn about asm, try to figure out what the differences are. see https://forum.nim-lang.org/t/10821 --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Don't recurse into inner functions during asyncjs transform (#23036)Jake Leahy2023-12-061-0/+2
| | | Closes #13341
* Removed `localStorage.hasKey` binding (#22766)Thiago2023-09-281-1/+0
| | | | | | | | Doesn't exists anymore. Use `window.localStorage.getItem("key").isNil` instead ![Screenshot from 2023-09-28 07-22-41](https://github.com/nim-lang/Nim/assets/74574275/65d58921-58c7-4a81-9f3b-5faa3a79c4f2)
* Fix #21407 (#22759)Juan Carlos2023-09-281-0/+8
| | | | | | | - Fix #21407 --------- Co-authored-by: Amjad Ben Hedhili <amjadhedhili@outlook.com>
* make jsffi properly gensym (#22539)metagn2023-08-231-22/+29
| | | fixes #21208
* replace `doAssert false` with `raiseAssert` in lib, which works better with ↵ringabout2023-08-111-3/+3
| | | | strictdefs (#22458)
* JS: Add some to-cstring converters for DateTime (#21912)Zoom2023-05-261-4/+11
| | | | | Add some to-cstring converters for DateTime Changelog update
* Fixed `window.find` return (#21621)Thiago2023-04-191-1/+1
| | | https://developer.mozilla.org/en-US/docs/Web/API/Window/find
* int64/uint64 as bigint in JS (#21613)metagn2023-04-111-2/+9
| | | | | | | | | | | * int64/uint64 as bigint in JS * fix CI * convert to compile option * fix lie * smaller diff, changelog entry
* add .replace() with callback to jsre (#21371)Qinsi (James) ZHU2023-02-161-0/+5
|
* `std/asyncjs` allow transforming proc types (#21356)Jake Leahy2023-02-141-1/+9
| | | | | * Add test case * Implement JS async transform for nnkProcTy
* dom: remove X* = ref XObj [backport] (#20910)metagn2022-11-291-76/+37
| | | dom: remove X* = ref XObj
* Documentation only, dom (#20584)Juan Carlos2022-10-171-0/+31
| | | Add docs to dom
* Markdown code blocks migration part 7 (#20547)Andrey Makarov2022-10-123-45/+50
|
* Add missing proc to dom (#20378)Juan Carlos2022-09-191-0/+57
| | | | | | | | | * Add missing proc from dom * Add missing proc from dom * Add missing proc from dom Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* Add missing symbols to regex (#20383)Juan Carlos2022-09-191-0/+1
| | | | | * Add missing attribute to jsre * Add missing attribute to jsre
* jsffi add missing braces (#19948)Juan Carlos2022-06-301-10/+10
| | | js codegen add missing whitespaces and braces
* Fix jsre (#19917)Juan Carlos2022-06-281-3/+5
| | | | | * Fixes for jsre to make it more safe at runtime on some edge cases * https://github.com/nim-lang/Nim/pull/19917#issuecomment-1162692893
* Add Microtasks docs (#19870)Juan Carlos2022-06-081-1/+1
| | | | | | | * Add Microtasks * Add Microtasks * Workaround to build js docs in older NodeJS versions
* Add Microtasks (#19860)Juan Carlos2022-06-041-0/+5
| | | | | * Add Microtasks * Add Microtasks
* change the type of mangleJsName; fixes CStringConv warnings (#19852)flywind2022-06-011-6/+6
| | | | | change the type of mangleJsName since mangleJsName is used in macros, there is no need to use cstring. Using cstring may increase conversions and cause warnings.
* Add `document.hidden` and `document.visibilityState` properties (#19817)tandy10002022-05-241-0/+2
|
* Add Array.shift (#19811)Juan Carlos2022-05-241-0/+9
| | | | | * Add Array.shift for JavaScript targets * Add Array.shift for JavaScript targets
* Add support for `Window.matchMedia` (#19648)tandy10002022-03-261-0/+6
|
* Remove Deprecated domextension (#19630)Juan Carlos2022-03-231-3/+0
| | | | | * Remove Deprecated domextension * Remove Deprecated domextension
* Remove define for jsfetch (#19530)Juan Carlos2022-02-251-88/+88
| | | | | | | | | * Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch * Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch * Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch * Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch
* Remove Deprecated jsre func (#19551)Juan Carlos2022-02-251-4/+0
| | | | | | | * Remove Deprecated jsre func * Remove Deprecated jsre func * ReStart CI, because OSX is dumb and I have no permission to restart
* remove spaces between an identifier and a star (#19355)flywind2022-01-101-19/+19
| | | | | It makes search easier by searching `+`* instead of `+` which filter lots of unexported versions. Follow https://github.com/nim-lang/Nim/pull/18681
* Implement RFC-413 (#18749)Juan Carlos2021-08-262-4/+5
| | | | | | | | | | | | | | | | | | | | | | * Implement RFC 413 * Implement RFC 413 * Implement RFC 413 * Implement RFC 413 * https://github.com/nim-lang/Nim/pull/18749#discussion_r696320995 * Update lib/js/dom_extensions.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update lib/js/dom_extensions.nim * https://github.com/nim-lang/Nim/pull/18749#discussion_r696913310 Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Cleanup interval and timeout procs (#18431)Antonis Geralis2021-07-051-8/+10
| | | clear/setTimeout procs were using ref ref Timeout. Added more interval overloads. Corrections.
* readAsText supports both Blob and File (fixes #18187) (#18189)mantielero2021-06-211-2/+2
|
* add `dom.scrollIntoView` with options; refs #18093 (#18181)Rainbow Asteroids2021-06-051-0/+6
|
* Add `checked` to dom (#18033)Joey2021-05-171-0/+3
| | | This allows the ability to set a checkbox as checked programmatically. It's different from `setAttribute` because once an input has been clicked on by the user, `setAttribute` no longer works programmatically.
* Add copyWithin for JavaScript (#17937)Juan Carlos2021-05-051-0/+13
| | | | * Add jscore.copyWithin for seq and array * Shallow copy mention docs
* WIP: Added missing functions to jsre module (#17881)Yanis Zafirópulos2021-05-011-0/+30
| | | | | | | * added missing functions: `replace`, `replaceAll`, `split`, `match` * added `startsWith` & `endsWith` * Update lib/js/jsre.nim Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
* `typeof(voidStmt)` now works (#17807)Timothee Cour2021-04-231-5/+2
| | | | | | | | * `typeof(voidStmt)` now works * remove typeOrVoid * add condsyms, and reference cligen https://github.com/c-blake/cligen/pull/193 * fixup * changelog [skip ci] * fixup
* Documentation only, dom (#17770)Juan Carlos2021-04-191-1/+3
| | | | | | | | | | | | | | * ReSync with Devel * ReSync * https://github.com/timotheecour/Nim/issues/674 * Update lib/js/dom.nim Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: flywind <xzsflywind@gmail.com>
* Fix small typos (#17680)konsumlamm2021-04-091-0/+1
|
* Improve jsre (#17365)Juan Carlos2021-03-211-30/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add dollar for regex * Add dollar for regex * Peer review feedbacks * Peer review feedbacks * Update lib/js/jsre.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Update lib/js/jsre.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Update lib/js/jsre.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Pear review * Beer review * Beer review Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* Use importjs (#17422)konsumlamm2021-03-193-54/+54
|
* improve jsconsole (#17414)Juan Carlos2021-03-191-0/+10
| | | | | | | | | * Add jsconsole.dir * Update lib/js/jsconsole.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* Documentation only jsconsole (#17384)Juan Carlos2021-03-161-0/+12
| | | | Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* Add Debug breakpoints support (#17295)Juan Carlos2021-03-081-0/+6
| | | | | * Add Debug breakpoints support * Add Debug breakpoints support
* followup #16871 asyncjs.then: allow pipelining procs returning futures (#17189)Timothee Cour2021-03-041-21/+58
| | | | | | | | | | * followup #16871 asyncjs.then: allow pipelining procs returning futures * rename test files where they belong * fix tests * tests for then with `onReject` callback * rename test file containing fail to avoid messing with grep * address comments * cleanup * un-disable 1 test
* fix #17177 (#17243)flywind2021-03-031-2/+3
| | | | | | | | | * remove unnecessary when statement * remove outdated codes * fix #17177 * add testcase
* make jsconsole.assertion errors less confusing in logs (#17179)Timothee Cour2021-02-251-1/+1
| | | | | | | * make jsconsole.assertion errors less confusing in logs * address comments * fixup
* asyncjs: add `then`, `catch` for promise pipelining (#16871)Timothee Cour2021-02-241-3/+66
| | | | | | * asyncjs: add then * improve tests, changelog, API * fix cryptic windows error: The parameter is incorrect * address comments
* add createElementNS, will hopefully fix svgs for karax (#16938)Antonis Geralis2021-02-051-0/+1
|