| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 | 60 |
| 61 namespace v8 { | 61 namespace v8 { |
| 62 namespace internal { | 62 namespace internal { |
| 63 | 63 |
| 64 | 64 |
| 65 Handle<Object> RegExpImpl::CreateRegExpLiteral(Handle<JSFunction> constructor, | 65 Handle<Object> RegExpImpl::CreateRegExpLiteral(Handle<JSFunction> constructor, |
| 66 Handle<String> pattern, | 66 Handle<String> pattern, |
| 67 Handle<String> flags, | 67 Handle<String> flags, |
| 68 bool* has_pending_exception) { | 68 bool* has_pending_exception) { |
| 69 // Ensure that the constructor function has been loaded. | |
| 70 if (!constructor->IsLoaded()) { | |
| 71 LoadLazy(constructor, has_pending_exception); | |
| 72 if (*has_pending_exception) return Handle<Object>(); | |
| 73 } | |
| 74 // Call the construct code with 2 arguments. | 69 // Call the construct code with 2 arguments. |
| 75 Object** argv[2] = { Handle<Object>::cast(pattern).location(), | 70 Object** argv[2] = { Handle<Object>::cast(pattern).location(), |
| 76 Handle<Object>::cast(flags).location() }; | 71 Handle<Object>::cast(flags).location() }; |
| 77 return Execution::New(constructor, 2, argv, has_pending_exception); | 72 return Execution::New(constructor, 2, argv, has_pending_exception); |
| 78 } | 73 } |
| 79 | 74 |
| 80 | 75 |
| 81 static JSRegExp::Flags RegExpFlagsFromString(Handle<String> str) { | 76 static JSRegExp::Flags RegExpFlagsFromString(Handle<String> str) { |
| 82 int flags = JSRegExp::NONE; | 77 int flags = JSRegExp::NONE; |
| 83 for (int i = 0; i < str->length(); i++) { | 78 for (int i = 0; i < str->length(); i++) { |
| (...skipping 5167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5251 node, | 5246 node, |
| 5252 data->capture_count, | 5247 data->capture_count, |
| 5253 pattern); | 5248 pattern); |
| 5254 } | 5249 } |
| 5255 | 5250 |
| 5256 | 5251 |
| 5257 int OffsetsVector::static_offsets_vector_[ | 5252 int OffsetsVector::static_offsets_vector_[ |
| 5258 OffsetsVector::kStaticOffsetsVectorSize]; | 5253 OffsetsVector::kStaticOffsetsVectorSize]; |
| 5259 | 5254 |
| 5260 }} // namespace v8::internal | 5255 }} // namespace v8::internal |
| OLD | NEW |