| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 CHECK_NOT_NULL(inner->body()); | 1470 CHECK_NOT_NULL(inner->body()); |
| 1471 CHECK_GE(2, inner->body()->length()); | 1471 CHECK_GE(2, inner->body()->length()); |
| 1472 i::Expression* exp = inner->body()->at(1)->AsExpressionStatement()-> | 1472 i::Expression* exp = inner->body()->at(1)->AsExpressionStatement()-> |
| 1473 expression()->AsBinaryOperation()->right(); | 1473 expression()->AsBinaryOperation()->right(); |
| 1474 if (exp->IsFunctionLiteral()) { | 1474 if (exp->IsFunctionLiteral()) { |
| 1475 fun = exp->AsFunctionLiteral(); | 1475 fun = exp->AsFunctionLiteral(); |
| 1476 } else if (exp->IsObjectLiteral()) { | 1476 } else if (exp->IsObjectLiteral()) { |
| 1477 fun = exp->AsObjectLiteral()->properties()->at(0)->value()-> | 1477 fun = exp->AsObjectLiteral()->properties()->at(0)->value()-> |
| 1478 AsFunctionLiteral(); | 1478 AsFunctionLiteral(); |
| 1479 } else { | 1479 } else { |
| 1480 fun = exp->AsClassLiteral()->properties()->at(0)->value()-> | 1480 fun = exp->AsDoExpression()->represented_function(); |
| 1481 AsFunctionLiteral(); | |
| 1482 } | 1481 } |
| 1483 } | 1482 } |
| 1484 CHECK_NULL(fun->body()); | 1483 CHECK_NULL(fun->body()); |
| 1485 } | 1484 } |
| 1486 } | 1485 } |
| 1487 | 1486 |
| 1488 | 1487 |
| 1489 const char* ReadString(unsigned* start) { | 1488 const char* ReadString(unsigned* start) { |
| 1490 int length = start[0]; | 1489 int length = start[0]; |
| 1491 char* result = i::NewArray<char>(length + 1); | 1490 char* result = i::NewArray<char>(length + 1); |
| (...skipping 6472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7964 "(a,);", | 7963 "(a,);", |
| 7965 "(a,b,c,);", | 7964 "(a,b,c,);", |
| 7966 NULL | 7965 NULL |
| 7967 }; | 7966 }; |
| 7968 // clang-format on | 7967 // clang-format on |
| 7969 | 7968 |
| 7970 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; | 7969 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; |
| 7971 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, | 7970 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
| 7972 arraysize(always_flags)); | 7971 arraysize(always_flags)); |
| 7973 } | 7972 } |
| OLD | NEW |