| 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 29 matching lines...) Expand all Loading... |
| 40 MultilineMode multilineMode, | 40 MultilineMode multilineMode, |
| 41 CharacterMode charMode) { | 41 CharacterMode charMode) { |
| 42 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 42 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 43 v8::HandleScope handleScope(isolate); | 43 v8::HandleScope handleScope(isolate); |
| 44 v8::Local<v8::Context> context = | 44 v8::Local<v8::Context> context = |
| 45 V8PerIsolateData::from(isolate)->ensureScriptRegexpContext(); | 45 V8PerIsolateData::from(isolate)->ensureScriptRegexpContext(); |
| 46 v8::Context::Scope contextScope(context); | 46 v8::Context::Scope contextScope(context); |
| 47 v8::TryCatch tryCatch(isolate); | 47 v8::TryCatch tryCatch(isolate); |
| 48 | 48 |
| 49 unsigned flags = v8::RegExp::kNone; | 49 unsigned flags = v8::RegExp::kNone; |
| 50 if (caseSensitivity == TextCaseInsensitive) | 50 if (caseSensitivity != TextCaseSensitive) |
| 51 flags |= v8::RegExp::kIgnoreCase; | 51 flags |= v8::RegExp::kIgnoreCase; |
| 52 if (multilineMode == MultilineEnabled) | 52 if (multilineMode == MultilineEnabled) |
| 53 flags |= v8::RegExp::kMultiline; | 53 flags |= v8::RegExp::kMultiline; |
| 54 if (charMode == UTF16) | 54 if (charMode == UTF16) |
| 55 flags |= v8::RegExp::kUnicode; | 55 flags |= v8::RegExp::kUnicode; |
| 56 | 56 |
| 57 v8::Local<v8::RegExp> regex; | 57 v8::Local<v8::RegExp> regex; |
| 58 if (v8::RegExp::New(context, v8String(isolate, pattern), | 58 if (v8::RegExp::New(context, v8String(isolate, pattern), |
| 59 static_cast<v8::RegExp::Flags>(flags)) | 59 static_cast<v8::RegExp::Flags>(flags)) |
| 60 .ToLocal(®ex)) | 60 .ToLocal(®ex)) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 v8::Local<v8::Value> match; | 119 v8::Local<v8::Value> match; |
| 120 if (!result->Get(context, 0).ToLocal(&match)) | 120 if (!result->Get(context, 0).ToLocal(&match)) |
| 121 return -1; | 121 return -1; |
| 122 *matchLength = match.As<v8::String>()->Length(); | 122 *matchLength = match.As<v8::String>()->Length(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 return matchOffset.As<v8::Int32>()->Value() + startFrom; | 125 return matchOffset.As<v8::Int32>()->Value() + startFrom; |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace blink | 128 } // namespace blink |
| OLD | NEW |