}
id : 7
}
-{
- error : {
- code : -32601
- message : "Method not found."
- data : [
- "Invalid method name was received. 'Page.test' wasn't found."
- ]
- }
- id : 8
-}
-{
- error : {
- code : -32601
- message : "Method not found."
- data : [
- "Invalid method name was received. 'Page.test' wasn't found."
- ]
- }
- id : 9
-}
-{
- error : {
- code : -32601
- message : "Method not found."
- data : [
- "Invalid method name was received. 'Page.test' wasn't found."
- ]
- }
- id : 10
-}
-{
- error : {
- code : -32601
- message : "Method not found."
- data : [
- "Invalid method name was received. 'Page.test' wasn't found."
- ]
- }
- id : 11
-}
-{
- error : {
- code : -32601
- message : "Method not found."
- data : [
- "Invalid method name was received. 'Page.test' wasn't found."
- ]
- }
- id : 12
-}
-{
- error : {
- code : -32601
- message : "Method not found."
- data : [
- "Invalid method name was received. 'Page.test' wasn't found."
- ]
- }
- id : 13
-}
-{
- error : {
- code : -32601
- message : "Method not found."
- data : [
- "Invalid method name was received. 'Page.test' wasn't found."
- ]
- }
- id : 14
-}
-{
- error : {
- code : -32601
- message : "Method not found."
- data : [
- "Invalid method name was received. 'Page.test' wasn't found."
- ]
- }
- id : 15
-}
-{
- error : {
- code : -32601
- message : "Method not found."
- data : [
- "Invalid method name was received. 'Page.test' wasn't found."
- ]
- }
- id : 16
-}
'{"id":5,"method":"Page.getResourceContent","params":[]}',
'{"id":6,"method":"Page.getResourceContent","params":{}}',
'{"id":7,"method":"Page.getResourceContent","params":{"frameId":"not a number"}}',
- '{"id":8,"method":"Page.test"}',
- '{"id":9,"method":"Page.test" }',
- '{"id":10,"method": "Page.test" }',
- '{"id":11,"method" : "Page.test" }',
- '{"id":12, "method" : "Page.test" }',
- '{"id": 13, "method" : "Page.test" }',
- '{"id" : 14, "method" : "Page.test" }',
- '{ "id" : 15, "method" : "Page.test" }',
- '{ "id"\n :\r 16,\t "method"\f :\v "Page.test" }',
];
var numberOfReports = 0;
return false;
}
-Token parseToken(const UChar* start, const UChar* end, const UChar** tokenStart, const UChar** tokenEnd)
+Token parseToken(const UChar* start, const UChar* end, const UChar** tokenEnd)
{
- while (start < end && u_isspace(*start))
- ++start;
-
if (start == end)
return INVALID_TOKEN;
- *tokenStart = start;
-
switch (*start) {
case 'n':
if (parseConstToken(start, end, tokenEnd, nullString))
return 0;
RefPtr<InspectorValue> result;
- const UChar* tokenStart;
const UChar* tokenEnd;
- Token token = parseToken(start, end, &tokenStart, &tokenEnd);
+ Token token = parseToken(start, end, &tokenEnd);
switch (token) {
case INVALID_TOKEN:
return 0;
break;
case NUMBER: {
bool ok;
- double value = charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok);
+ double value = charactersToDouble(start, tokenEnd - start, &ok);
if (!ok)
return 0;
result = InspectorBasicValue::create(value);
}
case STRING: {
String value;
- bool ok = decodeString(tokenStart + 1, tokenEnd - 1, &value);
+ bool ok = decodeString(start + 1, tokenEnd - 1, &value);
if (!ok)
return 0;
result = InspectorString::create(value);
case ARRAY_BEGIN: {
RefPtr<InspectorArray> array = InspectorArray::create();
start = tokenEnd;
- token = parseToken(start, end, &tokenStart, &tokenEnd);
+ token = parseToken(start, end, &tokenEnd);
while (token != ARRAY_END) {
RefPtr<InspectorValue> arrayNode = buildValue(start, end, &tokenEnd, depth + 1);
if (!arrayNode)
// After a list value, we expect a comma or the end of the list.
start = tokenEnd;
- token = parseToken(start, end, &tokenStart, &tokenEnd);
+ token = parseToken(start, end, &tokenEnd);
if (token == LIST_SEPARATOR) {
start = tokenEnd;
- token = parseToken(start, end, &tokenStart, &tokenEnd);
+ token = parseToken(start, end, &tokenEnd);
if (token == ARRAY_END)
return 0;
} else if (token != ARRAY_END) {
case OBJECT_BEGIN: {
RefPtr<InspectorObject> object = InspectorObject::create();
start = tokenEnd;
- token = parseToken(start, end, &tokenStart, &tokenEnd);
+ token = parseToken(start, end, &tokenEnd);
while (token != OBJECT_END) {
if (token != STRING)
return 0;
String key;
- if (!decodeString(tokenStart + 1, tokenEnd - 1, &key))
+ if (!decodeString(start + 1, tokenEnd - 1, &key))
return 0;
start = tokenEnd;
- token = parseToken(start, end, &tokenStart, &tokenEnd);
+ token = parseToken(start, end, &tokenEnd);
if (token != OBJECT_PAIR_SEPARATOR)
return 0;
start = tokenEnd;
// After a key/value pair, we expect a comma or the end of the
// object.
- token = parseToken(start, end, &tokenStart, &tokenEnd);
+ token = parseToken(start, end, &tokenEnd);
if (token == LIST_SEPARATOR) {
start = tokenEnd;
- token = parseToken(start, end, &tokenStart, &tokenEnd);
+ token = parseToken(start, end, &tokenEnd);
if (token == OBJECT_END)
return 0;
} else if (token != OBJECT_END) {