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

Side by Side Diff: src/preparse-data.cc

Issue 7037024: Added preparser strict-mode tests. (Closed)
Patch Set: Address review comment. Created 9 years, 7 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 | « preparser/preparser-process.cc ('k') | src/preparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 preamble_[PreparseDataConstants::kHasErrorOffset] = true; 67 preamble_[PreparseDataConstants::kHasErrorOffset] = true;
68 function_store_.Reset(); 68 function_store_.Reset();
69 STATIC_ASSERT(PreparseDataConstants::kMessageStartPos == 0); 69 STATIC_ASSERT(PreparseDataConstants::kMessageStartPos == 0);
70 function_store_.Add(start_pos); 70 function_store_.Add(start_pos);
71 STATIC_ASSERT(PreparseDataConstants::kMessageEndPos == 1); 71 STATIC_ASSERT(PreparseDataConstants::kMessageEndPos == 1);
72 function_store_.Add(end_pos); 72 function_store_.Add(end_pos);
73 STATIC_ASSERT(PreparseDataConstants::kMessageArgCountPos == 2); 73 STATIC_ASSERT(PreparseDataConstants::kMessageArgCountPos == 2);
74 function_store_.Add((arg_opt == NULL) ? 0 : 1); 74 function_store_.Add((arg_opt == NULL) ? 0 : 1);
75 STATIC_ASSERT(PreparseDataConstants::kMessageTextPos == 3); 75 STATIC_ASSERT(PreparseDataConstants::kMessageTextPos == 3);
76 WriteString(CStrVector(message)); 76 WriteString(CStrVector(message));
77 if (arg_opt) WriteString(CStrVector(arg_opt)); 77 if (arg_opt != NULL) WriteString(CStrVector(arg_opt));
78 is_recording_ = false; 78 is_recording_ = false;
79 } 79 }
80 80
81 81
82 void FunctionLoggingParserRecorder::WriteString(Vector<const char> str) { 82 void FunctionLoggingParserRecorder::WriteString(Vector<const char> str) {
83 function_store_.Add(str.length()); 83 function_store_.Add(str.length());
84 for (int i = 0; i < str.length(); i++) { 84 for (int i = 0; i < str.length(); i++) {
85 function_store_.Add(str[i]); 85 function_store_.Add(str[i]);
86 } 86 }
87 } 87 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 symbol_store_.Add(static_cast<byte>(number >> i) | 0x80u); 174 symbol_store_.Add(static_cast<byte>(number >> i) | 0x80u);
175 number &= mask; 175 number &= mask;
176 } 176 }
177 mask >>= 7; 177 mask >>= 7;
178 } 178 }
179 symbol_store_.Add(static_cast<byte>(number)); 179 symbol_store_.Add(static_cast<byte>(number));
180 } 180 }
181 181
182 182
183 } } // namespace v8::internal. 183 } } // namespace v8::internal.
OLDNEW
« no previous file with comments | « preparser/preparser-process.cc ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698