From 5b74433cf94c7eda25a27e7e320f3889025f2380 Mon Sep 17 00:00:00 2001
From: Geoffrey Booth 
+      
+      Modules
+      ES2015 modules are supported in CoffeeScript, with a very similar import
+      and export syntax:
+    
+      Note that the CoffeeScript compiler does not resolve modules; writing an
+      import or export statement in CoffeeScript will produce an
+      import or export statement in the resulting output JavaScript.
+      It is your responsibility attach another transpiler, such as
+      Traceur Compiler,
+      Babel or
+      Rollup, to convert this ES2015 syntax into
+      code that will work in your target runtimes.
+    
       Note that the CoffeeScript compiler does not resolve modules; writing an
       import or export statement in CoffeeScript will produce an
-      import or export statement in the resulting output JavaScript.
+      import or export statement in the resulting output.
       It is your responsibility attach another transpiler, such as
       Traceur Compiler,
       Babel or
       Rollup, to convert this ES2015 syntax into
       code that will work in your target runtimes.
     
+      Also note that any file with an import or export statement will
+      be output without a top-level function safety wrapper;
+      in other words, importing or exporting modules will automatically trigger
+      bare mode for that file. This is because per the ES2015 spec,
+      import or export statements must occur at the topmost scope.
 
     
#{hljs.highlight('coffeescript', cs).value}#{hljs.highlight('javascript', js).value}var cube, square;
 
-square = function(x) {
+square = function(x) {
   return x * x;
 };
 
-cube = function(x) {
+cube = function(x) {
   return square(x) * x;
 };
 
       If you need to invoke one task before another — for example, running
       build before test, you can use the invoke function:
@@ -2292,8 +2290,8 @@ 
The best list of open-source CoffeeScript examples can be found on GitHub. But just - to throw out few more: + to throw out a few more:
<script type="text/coffeescript"> tags, to avoid
-          possible duplicate browser requests for .coffee files, 
+          possible duplicate browser requests for .coffee files,
           you can now use the data-src attribute instead of src.
         $ 'body'
-.click (e) ->
+.click (e) ->
   $ '.box'
   .fadeIn 'fast'
   .addClass '.active'
 .css 'background', 'white'
-$('body').click(function(e) {
+$('body').click(function(e) {
   return $('.box').fadeIn('fast').addClass('.active');
 }).css('background', 'white');
-**, // and %% operators and ... expansion in parameter lists and destructuring expressions.
From 50a112d281e0c7d8b6529ce1d43479cc1ca929c3 Mon Sep 17 00:00:00 2001
From: Geoffrey Booth var cube, square;
 
-square = function(x) {
+square = function(x) {
   return x * x;
 };
 
-cube = function(x) {
+cube = function(x) {
   return square(x) * x;
 };
 
       If you need to invoke one task before another — for example, running
       build before test, you can use the invoke function:
@@ -2290,8 +2292,8 @@ 
The best list of open-source CoffeeScript examples can be found on GitHub. But just - to throw out a few more: + to throw out few more:
<script type="text/coffeescript"> tags, to avoid
-          possible duplicate browser requests for .coffee files,
+          possible duplicate browser requests for .coffee files, 
           you can now use the data-src attribute instead of src.
         $ 'body'
-.click (e) ->
+.click (e) ->
   $ '.box'
   .fadeIn 'fast'
   .addClass '.active'
 .css 'background', 'white'
-$('body').click(function(e) {
+$('body').click(function(e) {
   return $('.box').fadeIn('fast').addClass('.active');
 }).css('background', 'white');
-**, // and %% operators and ... expansion in parameter lists and destructuring expressions.
From 502be0a3d03a278ee08a32485a458a1d1b6b4a4b Mon Sep 17 00:00:00 2001
From: Geoffrey Booth 
       If you'd like to create top-level variables for other scripts to use,
-      attach them as properties on window, or on the exports
-      object in CommonJS. The existential operator (covered below), gives you a
-      reliable way to figure out where to add them; if you're targeting both
-      CommonJS and the browser: exports ? this
+      attach them as properties on window; attach them as properties on the
+      exports object in CommonJS; or use an export
+      statement. If you’re targeting both CommonJS and the browser, the
+      existential operator (covered below), gives you a
+      reliable way to figure out where to add them: exports ? this
     
From 1745601a5a3b4e6306016b67c0cf41ffe4fa0a7d Mon Sep 17 00:00:00 2001
From: Geoffrey Booth  
       
       Modules
-      ES2015 modules are supported in CoffeeScript, with a very similar 
"
     # Temporary fix until highlight.js adds support for newer CoffeeScript reserved words
     if file is 'modules'
-      for reservedWord in ['import', 'export', 'from', 'as', 'default']
-        cshtml = cshtml.replace new RegExp("#{reservedWord} ", 'g'), "#{reservedWord} "
+      cshtml = cshtml.replace /(import|export|from|as|default) /g, '$1 '
     jshtml = "#{hljs.highlight('coffeescript', cs).value}
"
     append = if executable is yes then '' else "alert(#{executable});"
     if executable and executable != yes
diff --git a/documentation/index.html.js b/documentation/index.html.js
index bf5bed2c99..cd11a0b6bc 100644
--- a/documentation/index.html.js
+++ b/documentation/index.html.js
@@ -942,7 +942,7 @@ Expressions
     #{hljs.highlight('javascript', js).value}import
+      ES2015 modules are supported in CoffeeScript, with very similar import
       and export syntax: