Skip to content

mathiasbynens/browser-equivalence-edge-case

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

import Browser Equivalence Edge Case

This repo is a demonstration of an edge case in how JavaScript import behaves in Node --experimental-modules versus browsers.

Test #1: Node

In a version of Node with --experimental-modules, such as 10.5.0, go to this repo and run:

node --experimental-modules index.mjs

You should see In sloppy mode printed.

Test #2: Chrome

Download http-server if you don’t have it already:

npm install --global http-server

Then run http-server from this repo:

http-server

You should see a message saying that the folder is now being served at an address. Go to that address in Chrome (tested in version 69).

You should see In strict mode printed.

About

A demonstration of code that executes differently in Node and browsers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 71.4%
  • HTML 28.6%