@@ -120,8 +120,10 @@ Loader.prototype.resolve = function (key, parent) {
120
120
* as part of simplifying loader API implementation
121
121
*/
122
122
var iteratorSupport = typeof Symbol !== 'undefined' && Symbol . iterator ;
123
+ var REGISTRY = createSymbol ( 'registry' ) ;
123
124
function Registry ( ) {
124
- this . _registry = { } ;
125
+ this [ REGISTRY ] = { } ;
126
+ this . _registry = REGISTRY ;
125
127
}
126
128
// 4.4.1
127
129
if ( iteratorSupport ) {
@@ -132,7 +134,7 @@ if (iteratorSupport) {
132
134
133
135
// 4.4.3
134
136
Registry . prototype . entries = function ( ) {
135
- var registry = this . _registry ;
137
+ var registry = this [ REGISTRY ] ;
136
138
return arrayValues ( Object . keys ( registry ) . map ( function ( key ) {
137
139
return [ key , registry [ key ] ] ;
138
140
} ) ) ;
@@ -141,34 +143,34 @@ if (iteratorSupport) {
141
143
142
144
// 4.4.4
143
145
Registry . prototype . keys = function ( ) {
144
- return arrayValues ( Object . keys ( this . _registry ) ) ;
146
+ return arrayValues ( Object . keys ( this [ REGISTRY ] ) ) ;
145
147
} ;
146
148
// 4.4.5
147
149
Registry . prototype . values = function ( ) {
148
- var registry = this . _registry ;
150
+ var registry = this [ REGISTRY ] ;
149
151
return arrayValues ( Object . keys ( registry ) . map ( function ( key ) {
150
152
return registry [ key ] ;
151
153
} ) ) ;
152
154
} ;
153
155
// 4.4.6
154
156
Registry . prototype . get = function ( key ) {
155
- return this . _registry [ key ] ;
157
+ return this [ REGISTRY ] [ key ] ;
156
158
} ;
157
159
// 4.4.7
158
160
Registry . prototype . set = function ( key , namespace ) {
159
161
if ( ! ( namespace instanceof Module ) )
160
162
throw new Error ( 'Registry must be set with an instance of Module Namespace' ) ;
161
- this . _registry [ key ] = namespace ;
163
+ this [ REGISTRY ] [ key ] = namespace ;
162
164
return this ;
163
165
} ;
164
166
// 4.4.8
165
167
Registry . prototype . has = function ( key ) {
166
- return ! ! this . _registry [ key ] ;
168
+ return ! ! this [ REGISTRY ] [ key ] ;
167
169
} ;
168
170
// 4.4.9
169
171
Registry . prototype . delete = function ( key ) {
170
- if ( this . _registry [ key ] ) {
171
- delete this . _registry [ key ] ;
172
+ if ( this [ REGISTRY ] [ key ] ) {
173
+ delete this [ REGISTRY ] [ key ] ;
172
174
return true ;
173
175
}
174
176
return false ;
0 commit comments