mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
ac2da4e6b9
So far, only browser-based JS files were required to be in strict mode (in the
function form). This commit adds such a requirement to Node.js scripts where
the global form is preferred. All Node.js scripts in sloppy mode were
converted to strict mode.
Closes gh-4499
(cherry picked from commit bbad821c39
)
23 lines
495 B
JavaScript
23 lines
495 B
JavaScript
"use strict";
|
|
|
|
var fs = require( "fs" );
|
|
|
|
module.exports = function( grunt ) {
|
|
grunt.registerTask( "qunit_fixture", function() {
|
|
var dest = "./test/data/qunit-fixture.js";
|
|
fs.writeFileSync(
|
|
dest,
|
|
"// Generated by build/tasks/qunit_fixture.js\n" +
|
|
"QUnit.config.fixture = " +
|
|
JSON.stringify(
|
|
fs.readFileSync(
|
|
"./test/data/qunit-fixture.html",
|
|
"utf8"
|
|
).toString().replace( /\r\n/g, "\n" )
|
|
) +
|
|
";\n"
|
|
);
|
|
grunt.log.ok( "Updated " + dest + "." );
|
|
} );
|
|
};
|