Closed Bug 1567743 Opened 5 years ago Closed 5 years ago

Cannot execute a script containing a bigint literal from extension.

Categories

(WebExtensions :: General, defect)

68 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1559275

People

(Reporter: micah, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

Create an extension with the following background script and content script:

// background.js
browser.browserAction.onClicked.addListener(tab => contentInjector(tab).catch(console.error))
async function contentInjector(tab) {
	await browser.tabs.executeScript(tab.id, { file: './content.js' })
}
// content.js
const apple = 5n
console.log(apple)

Actual results:

Error: "identifier starts immediately after numeric literal"

Expected results:

The script should have been injected and executed.

Note: If you change const apple = BigInt(5) everything works as expected. My best guess is that the script is validated using a parser that hasn't been updated with the new bigint grammar before it is submitted to the page for execution.

Component: Untriaged → General
Product: Firefox → WebExtensions
Version: 68 Branch → Firefox 68
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Version: Firefox 68 → 68 Branch
You need to log in before you can comment on or make changes to this bug.