Summary: | [Content Extensions] Fail to parse invalid arrays | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||
Component: | WebCore Misc. | Assignee: | Alex Christensen <achristensen> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | ||||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Alex Christensen
2015-06-17 14:58:21 PDT
Created attachment 255039 [details]
Patch
Comment on attachment 255039 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255039&action=review > Source/WebCore/contentextensions/ContentExtensionParser.cpp:138 > + } else if (!resourceTypeValue.isUndefined()) else if (resourceTypeValue)? > Source/WebCore/contentextensions/ContentExtensionParser.cpp:146 > + } else if (!loadTypeValue.isUndefined()) ditto > Source/WebCore/contentextensions/ContentExtensionParser.cpp:158 > + } else if (!ifDomain.isUndefined()) ditto > Source/WebCore/contentextensions/ContentExtensionParser.cpp:171 > + } else if (!unlessDomain.isUndefined()) ditto > Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:820 > + checkCompilerError("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"webkit.org\",\"resource-type\":\"document\"}}]", Test passing null and undefined arguments? Maybe an array like object too? > Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:851 > + checkCompilerError("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"webkit.org\",\"if-domain\":5}}]", ContentExtensions::ContentExtensionError::JSONInvalidDomainList); > + checkCompilerError("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"webkit.org\",\"unless-domain\":5}}]", ContentExtensions::ContentExtensionError::JSONInvalidDomainList); > + checkCompilerError("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"webkit.org\",\"if-domain\":5,\"unless-domain\":5}}]", ContentExtensions::ContentExtensionError::JSONInvalidDomainList); ditto (In reply to comment #2) > > Source/WebCore/contentextensions/ContentExtensionParser.cpp:138 > > + } else if (!resourceTypeValue.isUndefined()) > > else if (resourceTypeValue)? Nope. That means something else. > > Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:820 > > + checkCompilerError("[{\"action\":{\"type\":\"block\"},\"trigger\":{\"url-filter\":\"webkit.org\",\"resource-type\":\"document\"}}]", > > Test passing null and undefined arguments? Maybe an array like object too? Done. |