Ignore:
Timestamp:
May 8, 2009, 6:01:16 PM (16 years ago)
Author:
[email protected]
Message:

Add a limited literal parser for eval to handle object and array literals fired at eval

Reviewed by Gavin Barraclough and Darin Adler.

This is a simplified parser and lexer that we can throw at strings passed to eval
in case a site is using eval to parse JSON (eg. json2.js). The lexer is intentionally
limited (in effect it's whitelisting a limited "common" subset of the JSON grammar)
as this decreases the likelihood of us wating time attempting to parse any significant
amount of non-JSON content.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r43311 r43424  
    185185                A7A1F7AD0F252B3C00E184E2 /* ByteArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A1F7AB0F252B3C00E184E2 /* ByteArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
    186186                A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */; };
     187                A7E2EA6B0FB460CF00601F06 /* LiteralParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E2EA690FB460CF00601F06 /* LiteralParser.h */; };
     188                A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */; };
    187189                BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; };
    188190                BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; };
     
    704706                A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableAllocator.h; sourceTree = "<group>"; };
    705707                A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocator.cpp; sourceTree = "<group>"; };
     708                A7E2EA690FB460CF00601F06 /* LiteralParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiteralParser.h; sourceTree = "<group>"; };
     709                A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralParser.cpp; sourceTree = "<group>"; };
    706710                A7E42C180E3938830065A544 /* JSStaticScopeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStaticScopeObject.h; sourceTree = "<group>"; };
    707711                A7E42C190E3938830065A544 /* JSStaticScopeObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStaticScopeObject.cpp; sourceTree = "<group>"; };
     
    14251429                                F692A8860255597D01FF60F7 /* UString.h */,
    14261430                                A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */,
     1431                                A7E2EA690FB460CF00601F06 /* LiteralParser.h */,
     1432                                A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */,
    14271433                        );
    14281434                        path = runtime;
     
    17971803                                96DD73790F9DA3100027FBCC /* VMTags.h in Headers */,
    17981804                                A76EE6590FAE59D5003F069A /* NativeFunctionWrapper.h in Headers */,
     1805                                A7E2EA6B0FB460CF00601F06 /* LiteralParser.h in Headers */,
    17991806                        );
    18001807                        runOnlyForDeploymentPostprocessing = 0;
     
    21542161                                86EAC4990F93E8D1008EC948 /* RegexJIT.cpp in Sources */,
    21552162                                86DB64640F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp in Sources */,
     2163                                A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */,
    21562164                        );
    21572165                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.