Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b98c232

Browse files
committed
feat(strict mode): turn on ECMAScript 5 strict mode
- add 'use strict'; statement to the prefix file - configure closure compiler to use the ES5 strict mode - strip all file-specific strict mode flags after concatination Closes #223
1 parent 4c6d26a commit b98c232

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Rakefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,15 @@ task :compile => [:init, :compile_scenario, :compile_jstd_scenario_adapter, :gen
188188

189189
File.open(path_to('angular.js'), 'w') do |f|
190190
concat = 'cat ' + deps.flatten.join(' ')
191-
f.write(%x{#{concat}})
191+
f.write(%x{#{concat}}.
192+
gsub(/^\s*['"]use strict['"];?\s*$/, ''). # remove all file-specific strict mode flags
193+
gsub(/'USE STRICT'/, "'use strict'")) # rename the placeholder in angular.prefix
192194
f.write(gen_css('css/angular.css', true))
193195
end
194196

195197
%x(java -jar lib/closure-compiler/compiler.jar \
196198
--compilation_level SIMPLE_OPTIMIZATIONS \
199+
--language_in ECMASCRIPT5_STRICT \
197200
--js #{path_to('angular.js')} \
198201
--js_output_file #{path_to('angular.min.js')})
199202
end

src/angular.prefix

+1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
* THE SOFTWARE.
2323
*/
24+
'USE STRICT';
2425
(function(window, document, undefined){

0 commit comments

Comments
 (0)