Bug with variable scoping
See original GitHub issueThere seems to be a major issue with the scoping of variables, that are not available for all files.
Unfortunately I’m not sure which component of pug is the root cause for this.
I have prepared a small sample here: https://github.com/Tiliavir/pug-variable-scope-issue
Simply CO, run npm run build
and check the output vs. the resulting HTML. Subtitle should be empty in most files, but are used in files where subtitle is not specified.
My output is:
PS C:\pug-variable-scope-issue> npm run build
> var-issue@1.0.0 build C:\pug-variable-scope-issue
> node -v && npm -v && gulp
v6.9.1
3.10.8
[10:16:53] Using gulpfile C:\pug-variable-scope-issue\
[10:16:53] Starting 'default'...
[10:16:53] Finished 'default' after 17 ms
1 - undefined
2 - sub2
3 - undefined
4 - undefined
5 - sub5
6 - undefined
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Variable Scope | Fix error: 'yourVariable' was not declared in ...
In this lesson, we are going to talk SUPER BASICALLY about variable scope. There are so many technical details we could dive into,...
Read more >Debug scope bug - Visual Studio Feedback
pngRecently, in a class for my Unity project, I encountered a strange bug where debug mode claims a variable is out of scope...
Read more >Fixing Variable Scope Issues with ECMAScript 6 - A List Apart
Scope is the area in which a variable is known. Take a look at the following code: var myVar = 1; function setMyVar()...
Read more >Safari bug with block scoped variables? - Stack Overflow
Might need to point out that function declarations are block scoped in strict mode but variables declarations aren't.
Read more >variable scope bug · Issue #1434 · traefik/yaegi - GitHub
The following program sample.go triggers an unexpected result package main import "fmt" func main() { s := make([]map[string]string, ...
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
@Tiliavir Hey. Yeah, I can merge these PRs and make a new release.
Fixed! Works like a charm …