This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ var $resourceMinErr = angular.$$minErr('$resource');
5
5
// Helper functions and regex to lookup a dotted path on an object
6
6
// stopping at undefined/null. The path must be composed of ASCII
7
7
// identifiers (just like $parse)
8
- var MEMBER_NAME_REGEX = / ^ ( \. [ a - z A - Z _ $ ] [ 0 - 9 a - z A - Z _ $ ] * ) + $ / ;
8
+ var MEMBER_NAME_REGEX = / ^ ( \. [ a - z A - Z _ $ @ ] [ 0 - 9 a - z A - Z _ $ ] * ) + $ / ;
9
9
10
10
function isValidDottedPath ( path ) {
11
11
return ( path != null && path !== '' && path !== 'hasOwnProperty' &&
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ describe("resource", function() {
44
44
expect ( isValidDottedPath ( '1abc' ) ) . toBe ( false ) ;
45
45
expect ( isValidDottedPath ( '.' ) ) . toBe ( false ) ;
46
46
expect ( isValidDottedPath ( '$' ) ) . toBe ( true ) ;
47
+ expect ( isValidDottedPath ( '@' ) ) . toBe ( true ) ;
47
48
expect ( isValidDottedPath ( 'a' ) ) . toBe ( true ) ;
48
49
expect ( isValidDottedPath ( 'A' ) ) . toBe ( true ) ;
49
50
expect ( isValidDottedPath ( 'a1' ) ) . toBe ( true ) ;
@@ -53,6 +54,8 @@ describe("resource", function() {
53
54
expect ( isValidDottedPath ( '$.$' ) ) . toBe ( true ) ;
54
55
expect ( isValidDottedPath ( '.$' ) ) . toBe ( false ) ;
55
56
expect ( isValidDottedPath ( '$.' ) ) . toBe ( false ) ;
57
+ expect ( isValidDottedPath ( '@.' ) ) . toBe ( false ) ;
58
+ expect ( isValidDottedPath ( '.@' ) ) . toBe ( false ) ;
56
59
} ) ;
57
60
} ) ;
58
61
You can’t perform that action at this time.
0 commit comments