This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ forEach({
9292 CONSTANTS [ name ] = constantGetter ;
9393} ) ;
9494
95+ //Not quite a constant, but can be lex/parsed the same
96+ CONSTANTS [ 'this' ] = function ( self ) { return self ; } ;
97+ CONSTANTS [ 'this' ] . sharedGetter = true ;
98+
99+
95100//Operators - will be wrapped by binaryFn/unaryFn/assignment/filter
96101var OPERATORS = extend ( createMap ( ) , {
97102 /* jshint bitwise : false */
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ function $RootScopeProvider(){
128128 this . $$phase = this . $parent = this . $$watchers =
129129 this . $$nextSibling = this . $$prevSibling =
130130 this . $$childHead = this . $$childTail = null ;
131- this [ 'this' ] = this . $root = this ;
131+ this . $root = this ;
132132 this . $$destroyed = false ;
133133 this . $$asyncQueue = [ ] ;
134134 this . $$postDigestQueue = [ ] ;
@@ -212,7 +212,6 @@ function $RootScopeProvider(){
212212 }
213213 child = new this . $$ChildScope ( ) ;
214214 }
215- child [ 'this' ] = child ;
216215 child . $parent = this ;
217216 child . $$prevSibling = this . $$childTail ;
218217 if ( this . $$childHead ) {
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ describe('Scope', function() {
5252
5353 describe ( 'this' , function ( ) {
5454 it ( 'should have a \'this\'' , inject ( function ( $rootScope ) {
55- expect ( $rootScope [ 'this' ] ) . toEqual ( $rootScope ) ;
55+ expect ( $rootScope . $eval ( 'this' ) ) . toEqual ( $rootScope ) ;
5656 } ) ) ;
5757 } ) ;
5858
You can’t perform that action at this time.
0 commit comments