Kleur crashes when there's a global variable keys
See original GitHub issueHi! My app uses global.keys
constant. Unfortunately, it conflicts with Kleur internal magic.
function init(key) {
return function (txt) {
let isChain = !!this.keys; // <<<
...
};
}
As global.keys
becomes something different:
this.keys.includes is not a function
at /.../node_modules/kleur/index.js:95:26
I guess that’s how you detect chaining. Is it possible to use "use strict"
pragma and check if this
is undefined
instead of relying on global object field (which is not safe for libraries)?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
When I use global variables it crashes my kernel
First: ALWAYS Initialize variables especially global ones. ... call KERNEL_LOC ; RAX Has the pointer of the global variable jmp $.
Read more >Are static global variables as bad as global variables? How to ...
Imagine your requirements change and suddenly there are 5 keys running around. ... A static global variable is the same global variable, ...
Read more >interrupt function modifying global variables
In response to other posts where this topic has been mentioned, I was wondering if my project has some latent errors awaiting to...
Read more >Global Variables and States: Why So Much Hate?
Global variables are a common pitfall many developers fall into. Let's take a look why, and how we can fix this problem.
Read more >Programming FAQ — Python 3.11.1 documentation
Contents: Programming FAQ- General Questions- Is there a source code level debugger with ... What are the rules for local and global variables...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No problem. This way it works for me, yes.
Released in
v3.0.2
– thank you~!