Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-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 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1352 * because we know the structure of this object. | 1352 * because we know the structure of this object. |
| 1353 */ | 1353 */ |
| 1354 V8EXPORT double NumberValue() const; | 1354 V8EXPORT double NumberValue() const; |
| 1355 | 1355 |
| 1356 static inline Date* Cast(v8::Value* obj); | 1356 static inline Date* Cast(v8::Value* obj); |
| 1357 private: | 1357 private: |
| 1358 V8EXPORT static void CheckCast(v8::Value* obj); | 1358 V8EXPORT static void CheckCast(v8::Value* obj); |
| 1359 }; | 1359 }; |
| 1360 | 1360 |
| 1361 | 1361 |
| 1362 /** | |
| 1363 * An instance of the built-in RegExp constructor (ECMA-262, 15.10). | |
| 1364 */ | |
| 1365 class RegExp : public Value { | |
| 1366 public: | |
| 1367 enum Flags { | |
| 1368 kNone = 0, | |
| 1369 kGlobal = 1, | |
| 1370 kIgnoreCase = 2, | |
| 1371 kMultiline = 4 | |
| 1372 }; | |
| 1373 | |
| 1374 V8EXPORT static Local<RegExp> New(Handle<String> pattern, | |
|
Mads Ager (chromium)
2010/10/05 08:55:46
Could you add comments to this method as well. You
| |
| 1375 Flags flags); | |
| 1376 | |
| 1377 /** | |
| 1378 * Returns the value of the source property: a string representing | |
| 1379 * the regular expression. | |
| 1380 */ | |
| 1381 V8EXPORT Local<String> GetSource() const; | |
| 1382 | |
| 1383 V8EXPORT Flags GetFlags() const; | |
|
Mads Ager (chromium)
2010/10/05 08:55:46
Could you add comments to this method as well?
| |
| 1384 | |
| 1385 static inline RegExp* Cast(v8::Value* obj); | |
| 1386 | |
| 1387 private: | |
| 1388 V8EXPORT static void CheckCast(v8::Value* obj); | |
| 1389 }; | |
| 1390 | |
| 1391 | |
| 1362 enum PropertyAttribute { | 1392 enum PropertyAttribute { |
| 1363 None = 0, | 1393 None = 0, |
| 1364 ReadOnly = 1 << 0, | 1394 ReadOnly = 1 << 0, |
| 1365 DontEnum = 1 << 1, | 1395 DontEnum = 1 << 1, |
| 1366 DontDelete = 1 << 2 | 1396 DontDelete = 1 << 2 |
| 1367 }; | 1397 }; |
| 1368 | 1398 |
| 1369 enum ExternalArrayType { | 1399 enum ExternalArrayType { |
| 1370 kExternalByteArray = 1, | 1400 kExternalByteArray = 1, |
| 1371 kExternalUnsignedByteArray, | 1401 kExternalUnsignedByteArray, |
| (...skipping 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3610 | 3640 |
| 3611 | 3641 |
| 3612 Date* Date::Cast(v8::Value* value) { | 3642 Date* Date::Cast(v8::Value* value) { |
| 3613 #ifdef V8_ENABLE_CHECKS | 3643 #ifdef V8_ENABLE_CHECKS |
| 3614 CheckCast(value); | 3644 CheckCast(value); |
| 3615 #endif | 3645 #endif |
| 3616 return static_cast<Date*>(value); | 3646 return static_cast<Date*>(value); |
| 3617 } | 3647 } |
| 3618 | 3648 |
| 3619 | 3649 |
| 3650 RegExp* RegExp::Cast(v8::Value* value) { | |
| 3651 #ifdef V8_ENABLE_CHECKS | |
| 3652 CheckCast(value); | |
| 3653 #endif | |
| 3654 return static_cast<RegExp*>(value); | |
| 3655 } | |
| 3656 | |
| 3657 | |
| 3620 Object* Object::Cast(v8::Value* value) { | 3658 Object* Object::Cast(v8::Value* value) { |
| 3621 #ifdef V8_ENABLE_CHECKS | 3659 #ifdef V8_ENABLE_CHECKS |
| 3622 CheckCast(value); | 3660 CheckCast(value); |
| 3623 #endif | 3661 #endif |
| 3624 return static_cast<Object*>(value); | 3662 return static_cast<Object*>(value); |
| 3625 } | 3663 } |
| 3626 | 3664 |
| 3627 | 3665 |
| 3628 Array* Array::Cast(v8::Value* value) { | 3666 Array* Array::Cast(v8::Value* value) { |
| 3629 #ifdef V8_ENABLE_CHECKS | 3667 #ifdef V8_ENABLE_CHECKS |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3677 | 3715 |
| 3678 | 3716 |
| 3679 } // namespace v8 | 3717 } // namespace v8 |
| 3680 | 3718 |
| 3681 | 3719 |
| 3682 #undef V8EXPORT | 3720 #undef V8EXPORT |
| 3683 #undef TYPE_CHECK | 3721 #undef TYPE_CHECK |
| 3684 | 3722 |
| 3685 | 3723 |
| 3686 #endif // V8_H_ | 3724 #endif // V8_H_ |
| OLD | NEW |