Skip to content

Commit fd6e5e3

Browse files
committed
replace smart-quotes with regular quotes
1 parent 7d4aee3 commit fd6e5e3

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

gdocs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ function download(name, url) {
6464
// strip out all text annotations
6565
data = data.replace(/\[\w{1,3}\]/mg, '');
6666

67+
// fix smart-quotes
68+
data = data.replace(/[]/g, '"');
69+
data = data.replace(/[]/g, "'");
70+
71+
6772
data = data + '\n';
6873
fs.writeFileSync('docs/' + name, reflow(data, 100));
6974
}

src/Injector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function angularServiceInject(name, fn, inject, eager) {
9292
* extracting all arguments which start with $ or end with _ as the
9393
* injection names.
9494
*/
95-
var FN_ARGS = /^function [^\(]*\(([^\)]*)\)/;
95+
var FN_ARGS = /^function\s*[^\(]*\(([^\)]*)\)/;
9696
var FN_ARG_SPLIT = /,/;
9797
var FN_ARG = /^\s*(((\$?).+?)(_?))\s*$/;
9898
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;

test/InjectorSpec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,15 @@ describe('injector', function(){
6565
fn.$inject = ['a'];
6666
expect(injectionArgs(fn)).toBe(fn.$inject);
6767
expect(injectionArgs(function(){})).toEqual([]);
68+
expect(injectionArgs(function (){})).toEqual([]);
69+
expect(injectionArgs(function (){})).toEqual([]);
70+
expect(injectionArgs(function /* */ (){})).toEqual([]);
6871
});
6972

7073
it('should create $inject', function(){
7174
// keep the multi-line to make sure we can handle it
72-
function $f_n0(
75+
function $f_n0 /*
76+
*/(
7377
$a, // x, <-- looks like an arg but it is a comment
7478
b_, /* z, <-- looks like an arg but it is a
7579
multi-line comment

0 commit comments

Comments
 (0)