From c1c29eddb9cf9242aefdb9c34b19b932cd5cba6d Mon Sep 17 00:00:00 2001 From: nswbmw Date: Wed, 12 Dec 2018 13:15:55 +0800 Subject: [PATCH] feat: add `BigInt` support --- escodegen.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/escodegen.js b/escodegen.js index 54e7cfab..b7a15130 100644 --- a/escodegen.js +++ b/escodegen.js @@ -2312,6 +2312,11 @@ return 'null'; } + // BigInt, eg: 1n + if (typeof expr.bigint === 'string') { + return expr.raw; + } + if (typeof expr.value === 'string') { return escapeString(expr.value); }