Ticket #6778: 6778.patch

File 6778.patch, 2.2 KB (added by Garry Yao, 13 years ago)
  • trunk/test/test.js

     
    240240
    241241                [       "o={prop1:1,1:'Fred','var':'Reserved','#':'XYZ','do-it':1};" ],
    242242
     243                [       "o={'false':1,'true':1,'null':1};" ],
     244
    243245                [       "o['#']['var']=1;" ],
    244246
     247                [       "o['true']['false']['null']=1;" ],
     248
    245249                [       "a.b+=1;" ],
    246250
    247251                [       "(a?b:c).go();" ],
  • trunk/_source/includes/scriptcompressor.js

     
    172172                return !!isReserved.words[ word ];
    173173        };
    174174        // Taken from the ECMA-262.
    175         isReserved.words = { 'break':1,'else':1,'new':1,'var':1,'case':1,'finally':1,'return':1,'void':1,'catch':1,'for':1,'switch':1,'while':1,'continue':1,'function':1,'this':1,'with':1,'default':1,'if':1,'throw':1,'delete':1,'in':1,'try':1,'do':1,'instanceof':1,'typeof':1,'abstract':1,'enum':1,'int':1,'short':1,'boolean':1,'export':1,'interface':1,'static':1,'byte':1,'extends':1,'long':1,'super':1,'char':1,'final':1,'native':1,'synchronized':1,'class':1,'float':1,'package':1,'throws':1,'const':1,'goto':1,'private':1,'transient':1,'debugger':1,'implements':1,'protected':1,'volatile':1,'double':1,'import':1,'public':1 };
     175        // Additionally, "null" is reserved as null literals , "true" and "false" are reserved as boolean literals. (#6778)
     176        isReserved.words = { 'true':1,'false':1,'null':1,'break':1,'else':1,'new':1,'var':1,'case':1,'finally':1,'return':1,'void':1,'catch':1,'for':1,'switch':1,'while':1,'continue':1,'function':1,'this':1,'with':1,'default':1,'if':1,'throw':1,'delete':1,'in':1,'try':1,'do':1,'instanceof':1,'typeof':1,'abstract':1,'enum':1,'int':1,'short':1,'boolean':1,'export':1,'interface':1,'static':1,'byte':1,'extends':1,'long':1,'super':1,'char':1,'final':1,'native':1,'synchronized':1,'class':1,'float':1,'package':1,'throws':1,'const':1,'goto':1,'private':1,'transient':1,'debugger':1,'implements':1,'protected':1,'volatile':1,'double':1,'import':1,'public':1 };
    176177
    177178        var getPropParts = function( propNode, parts )
    178179        {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy