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

Side by Side Diff: src/api.cc

Issue 1419823010: Implement flag and source getters on RegExp.prototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@rproto
Patch Set: new webkit expectations Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 6129 matching lines...) Expand 10 before | Expand all | Expand 10 after
6140 6140
6141 6141
6142 // Assert that the static flags cast in GetFlags is valid. 6142 // Assert that the static flags cast in GetFlags is valid.
6143 #define REGEXP_FLAG_ASSERT_EQ(api_flag, internal_flag) \ 6143 #define REGEXP_FLAG_ASSERT_EQ(api_flag, internal_flag) \
6144 STATIC_ASSERT(static_cast<int>(v8::RegExp::api_flag) == \ 6144 STATIC_ASSERT(static_cast<int>(v8::RegExp::api_flag) == \
6145 static_cast<int>(i::JSRegExp::internal_flag)) 6145 static_cast<int>(i::JSRegExp::internal_flag))
6146 REGEXP_FLAG_ASSERT_EQ(kNone, NONE); 6146 REGEXP_FLAG_ASSERT_EQ(kNone, NONE);
6147 REGEXP_FLAG_ASSERT_EQ(kGlobal, GLOBAL); 6147 REGEXP_FLAG_ASSERT_EQ(kGlobal, GLOBAL);
6148 REGEXP_FLAG_ASSERT_EQ(kIgnoreCase, IGNORE_CASE); 6148 REGEXP_FLAG_ASSERT_EQ(kIgnoreCase, IGNORE_CASE);
6149 REGEXP_FLAG_ASSERT_EQ(kMultiline, MULTILINE); 6149 REGEXP_FLAG_ASSERT_EQ(kMultiline, MULTILINE);
6150 REGEXP_FLAG_ASSERT_EQ(kSticky, STICKY);
6151 REGEXP_FLAG_ASSERT_EQ(kUnicode, UNICODE_ESCAPES);
6150 #undef REGEXP_FLAG_ASSERT_EQ 6152 #undef REGEXP_FLAG_ASSERT_EQ
6151 6153
6152 v8::RegExp::Flags v8::RegExp::GetFlags() const { 6154 v8::RegExp::Flags v8::RegExp::GetFlags() const {
6153 i::Handle<i::JSRegExp> obj = Utils::OpenHandle(this); 6155 i::Handle<i::JSRegExp> obj = Utils::OpenHandle(this);
6154 return static_cast<RegExp::Flags>(obj->GetFlags().value()); 6156 return static_cast<RegExp::Flags>(obj->GetFlags().value());
6155 } 6157 }
6156 6158
6157 6159
6158 Local<v8::Array> v8::Array::New(Isolate* isolate, int length) { 6160 Local<v8::Array> v8::Array::New(Isolate* isolate, int length) {
6159 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); 6161 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
(...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after
8517 Address callback_address = 8519 Address callback_address =
8518 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8520 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8519 VMState<EXTERNAL> state(isolate); 8521 VMState<EXTERNAL> state(isolate);
8520 ExternalCallbackScope call_scope(isolate, callback_address); 8522 ExternalCallbackScope call_scope(isolate, callback_address);
8521 callback(info); 8523 callback(info);
8522 } 8524 }
8523 8525
8524 8526
8525 } // namespace internal 8527 } // namespace internal
8526 } // namespace v8 8528 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/bootstrapper.cc » ('j') | src/bootstrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698