| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Collabora Ltd. | 3 * Copyright (C) 2008 Collabora Ltd. |
| 4 * Copyright (C) 2011 Peter Varga (pvarga@webkit.org), University of Szeged | 4 * Copyright (C) 2011 Peter Varga (pvarga@webkit.org), University of Szeged |
| 5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "config.h" | 29 #include "config.h" |
| 30 #include "core/platform/text/RegularExpression.h" | 30 #include "core/platform/text/RegularExpression.h" |
| 31 | 31 |
| 32 // FIXME: These seem like a layering violation, but converting the strings manua
lly | 32 // FIXME: These seem like a layering violation, but converting the strings manua
lly |
| 33 // without v8String is difficult, and calling into v8 without V8RecursionScope w
ill | 33 // without v8String is difficult, and calling into v8 without V8RecursionScope w
ill |
| 34 // assert. Perhaps v8 basic utilities shouldn't be in bindings, or we should put | 34 // assert. Perhaps v8 basic utilities shouldn't be in bindings, or we should put |
| 35 // RegularExpression as some kind of abstract interface that's implemented in bi
ndings. | 35 // RegularExpression as some kind of abstract interface that's implemented in bi
ndings. |
| 36 #include "V8Binding.h" | 36 #include "bindings/v8/V8Binding.h" |
| 37 #include "V8PerIsolateData.h" | 37 #include "bindings/v8/V8PerIsolateData.h" |
| 38 #include "V8RecursionScope.h" | 38 #include "bindings/v8/V8RecursionScope.h" |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 RegularExpression::RegularExpression(const String& pattern, TextCaseSensitivity
caseSensitivity, MultilineMode multilineMode) | 42 RegularExpression::RegularExpression(const String& pattern, TextCaseSensitivity
caseSensitivity, MultilineMode multilineMode) |
| 43 { | 43 { |
| 44 v8::HandleScope handleScope; | 44 v8::HandleScope handleScope; |
| 45 v8::Local<v8::Context> context = V8PerIsolateData::current()->ensureRegexCon
text(); | 45 v8::Local<v8::Context> context = V8PerIsolateData::current()->ensureRegexCon
text(); |
| 46 v8::Context::Scope scope(context); | 46 v8::Context::Scope scope(context); |
| 47 | 47 |
| 48 unsigned flags = v8::RegExp::kNone; | 48 unsigned flags = v8::RegExp::kNone; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 if (matchLength) { | 99 if (matchLength) { |
| 100 v8::Local<v8::String> match = result->Get(0).As<v8::String>(); | 100 v8::Local<v8::String> match = result->Get(0).As<v8::String>(); |
| 101 *matchLength = match->Length(); | 101 *matchLength = match->Length(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 return matchOffset + startFrom; | 104 return matchOffset + startFrom; |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace WebCore | 107 } // namespace WebCore |
| OLD | NEW |