Merge pull request #6671 from Snuffleupagus/make-stripCommentHeaders-less-gready
Make `stripCommentHeaders` less greedy, to ensure that it doesn't eat 'use strict' directive at the top of files (PR 6627 follow-up)
This commit is contained in:
commit
0029000c9f
5
make.js
5
make.js
@ -606,8 +606,9 @@ target.singlefile = function() {
|
|||||||
function stripCommentHeaders(content, filename) {
|
function stripCommentHeaders(content, filename) {
|
||||||
var notEndOfComment = '(?:[^*]|\\*(?!/))+';
|
var notEndOfComment = '(?:[^*]|\\*(?!/))+';
|
||||||
var reg = new RegExp(
|
var reg = new RegExp(
|
||||||
'\n(?:/\\*' + notEndOfComment + '\\*/\\s*|//(?!#).*\n\\s*)+' +
|
'\n/\\* Copyright' + notEndOfComment + '\\*/\\s*' +
|
||||||
'\'use strict\';', 'g');
|
'(?:/\\*' + notEndOfComment + '\\*/\\s*|//(?!#).*\n\\s*)*' +
|
||||||
|
'\\s*\'use strict\';', 'g');
|
||||||
content = content.replace(reg, '');
|
content = content.replace(reg, '');
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* globals PDFJS */
|
|
||||||
/* Copyright 2012 Mozilla Foundation
|
/* Copyright 2012 Mozilla Foundation
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -13,6 +12,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
/* globals PDFJS */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* globals Document, error, PDFJS */
|
|
||||||
/* Copyright 2012 Mozilla Foundation
|
/* Copyright 2012 Mozilla Foundation
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -13,6 +12,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
/* globals Document, error, PDFJS */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user