Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
valtlai committed Apr 13, 2023
1 parent 80c93bf commit 077725a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ class Compiler extends Obj {
const args = [];
let kwargs = null;
const funcId = "macro_" + this._tmpid();
const keepFrame = (frame !== undefined);
const keepFrame = frame !== undefined;

// Type check the definition of the args
node.args.children.forEach((arg, i) => {
Expand Down
2 changes: 1 addition & 1 deletion src/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ function urlize(str, length, nofollow) {
length = Infinity;
}

const noFollowAttr = (nofollow === true ? ' rel="nofollow"' : "");
const noFollowAttr = nofollow === true ? ' rel="nofollow"' : "";

const words = str.split(/(\s+)/).filter((word) => {
// If the word has no length, bail. This can happen for str with
Expand Down
16 changes: 8 additions & 8 deletions src/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@ class Tokenizer {
} else if (tok === "none") {
return token(TOKEN_NONE, tok, lineno, colno);
/*
* Added to make the test `null is null` evaluate truthily.
* Otherwise, Nunjucks will look up null in the context and
* return `undefined`, which is not what we want. This *may* have
* consequences is someone is using null in their templates as a
* variable.
*/
* Added to make the test `null is null` evaluate truthily.
* Otherwise, Nunjucks will look up null in the context and
* return `undefined`, which is not what we want. This *may* have
* consequences is someone is using null in their templates as a
* variable.
*/
} else if (tok === "null") {
return token(TOKEN_NONE, tok, lineno, colno);
} else if (tok) {
Expand All @@ -252,10 +252,10 @@ class Tokenizer {
// Parse out the template text, breaking on tag
// delimiters because we need to look for block/variable start
// tags (don't use the full delimChars for optimization)
const beginChars = (this.tags.BLOCK_START.charAt(0) +
const beginChars = this.tags.BLOCK_START.charAt(0) +
this.tags.VARIABLE_START.charAt(0) +
this.tags.COMMENT_START.charAt(0) +
this.tags.COMMENT_END.charAt(0));
this.tags.COMMENT_END.charAt(0);

if (this.isFinished()) {
return null;
Expand Down
6 changes: 2 additions & 4 deletions src/runtime.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import * as lib from "./lib.js";

const arrayFrom = Array.from;
const supportsIterators = (
typeof Symbol === "function" && Symbol.iterator &&
typeof arrayFrom === "function"
);
const supportsIterators = typeof Symbol === "function" && Symbol.iterator &&
typeof arrayFrom === "function";

// Frames keep track of scoping both at compile-time and run-time so
// we know how to access variables. Block tags can introduce special
Expand Down

0 comments on commit 077725a

Please sign in to comment.