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

Side by Side Diff: src/jsregexp.cc

Issue 7710018: Fix typo in assert. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Readded missing test Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/interpreter-irregexp.cc ('k') | src/objects.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 String* needle = String::cast(re->DataAt(JSRegExp::kAtomPatternIndex)); 229 String* needle = String::cast(re->DataAt(JSRegExp::kAtomPatternIndex));
230 int needle_len = needle->length(); 230 int needle_len = needle->length();
231 ASSERT(needle->IsFlat()); 231 ASSERT(needle->IsFlat());
232 232
233 if (needle_len != 0) { 233 if (needle_len != 0) {
234 if (index + needle_len > subject->length()) { 234 if (index + needle_len > subject->length()) {
235 return isolate->factory()->null_value(); 235 return isolate->factory()->null_value();
236 } 236 }
237 237
238 String::FlatContent needle_content = 238 String::FlatContent needle_content = needle->GetFlatContent();
239 needle->GetFlatContent(no_heap_allocation); 239 String::FlatContent subject_content = subject->GetFlatContent();
240 String::FlatContent subject_content =
241 subject->GetFlatContent(no_heap_allocation);
242 ASSERT(needle_content.IsFlat()); 240 ASSERT(needle_content.IsFlat());
243 ASSERT(subject_content.IsFlat()); 241 ASSERT(subject_content.IsFlat());
244 // dispatch on type of strings 242 // dispatch on type of strings
245 index = (needle_content.IsAscii() 243 index = (needle_content.IsAscii()
246 ? (subject_content.IsAscii() 244 ? (subject_content.IsAscii()
247 ? SearchString(isolate, 245 ? SearchString(isolate,
248 subject_content.ToAsciiVector(), 246 subject_content.ToAsciiVector(),
249 needle_content.ToAsciiVector(), 247 needle_content.ToAsciiVector(),
250 index) 248 index)
251 : SearchString(isolate, 249 : SearchString(isolate,
(...skipping 5099 matching lines...) Expand 10 before | Expand all | Expand 10 after
5351 } 5349 }
5352 5350
5353 return compiler.Assemble(&macro_assembler, 5351 return compiler.Assemble(&macro_assembler,
5354 node, 5352 node,
5355 data->capture_count, 5353 data->capture_count,
5356 pattern); 5354 pattern);
5357 } 5355 }
5358 5356
5359 5357
5360 }} // namespace v8::internal 5358 }} // namespace v8::internal
OLDNEW
« no previous file with comments | « src/interpreter-irregexp.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698