Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: test/cctest/test-parsing.cc

Issue 987203003: [parser] parse arrow function only if no linefeed before => (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove extra newline between functions Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5546 matching lines...) Expand 10 before | Expand all | Expand 10 after
5557 static const ParserFlag always_flags[] = { 5557 static const ParserFlag always_flags[] = {
5558 kAllowStrongMode, kAllowHarmonyScoping 5558 kAllowStrongMode, kAllowHarmonyScoping
5559 }; 5559 };
5560 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags, 5560 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags,
5561 arraysize(always_flags)); 5561 arraysize(always_flags));
5562 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags, 5562 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags,
5563 arraysize(always_flags)); 5563 arraysize(always_flags));
5564 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags, 5564 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags,
5565 arraysize(always_flags)); 5565 arraysize(always_flags));
5566 } 5566 }
5567
5568
5569 TEST(ArrowFunctionASIErrors) {
5570 const char* context_data[][2] = {{"'use strict';", ""}, {"", ""},
5571 {NULL, NULL}};
5572
5573 const char* data[] = {
5574 "(a\n=> a)(1)",
5575 "(a/*\n*/=> a)(1)",
5576 "((a)\n=> a)(1)",
5577 "((a)/*\n*/=> a)(1)",
5578 "((a, b)\n=> a + b)(1, 2)",
5579 "((a, b)/*\n*/=> a + b)(1, 2)",
5580 NULL};
5581 static const ParserFlag always_flags[] = {kAllowHarmonyArrowFunctions};
5582 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
5583 arraysize(always_flags));
5584 }
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698