OLD | NEW |
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 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 * Tries to parse the string |json_string| and returns it as value if | 1529 * Tries to parse the string |json_string| and returns it as value if |
1530 * successful. | 1530 * successful. |
1531 * | 1531 * |
1532 * \param json_string The string to parse. | 1532 * \param json_string The string to parse. |
1533 * \return The corresponding value if successfully parsed. | 1533 * \return The corresponding value if successfully parsed. |
1534 */ | 1534 */ |
1535 static Local<Value> Parse(Local<String> json_string); | 1535 static Local<Value> Parse(Local<String> json_string); |
1536 }; | 1536 }; |
1537 | 1537 |
1538 | 1538 |
1539 /** | |
1540 * A map whose keys are referenced weakly. It is similar to JavaScript WeakMap | |
1541 * but can be created without entering a v8::Context and hence shouldn't | |
1542 * escape to JavaScript. | |
1543 */ | |
1544 class V8_EXPORT WeakMap { | |
1545 public: | |
1546 static WeakMap* New(Isolate* isolate); | |
1547 void Set(Handle<Value> key, Handle<Value> value); | |
1548 Local<Value> Get(Handle<Value> key); | |
1549 bool Has(Handle<Value> key); | |
1550 bool Delete(Handle<Value> key); | |
1551 | |
1552 private: | |
1553 WeakMap(Isolate* isolate, Handle<Object> weak_map) | |
1554 : isolate_(isolate), map_(isolate, weak_map) {} | |
1555 Isolate* isolate_; | |
1556 UniquePersistent<Object> map_; | |
1557 | |
1558 // Disallow copying and assigning. | |
1559 WeakMap(WeakMap&); | |
1560 void operator=(WeakMap&); | |
1561 }; | |
1562 | |
1563 | |
1564 // --- Value --- | 1539 // --- Value --- |
1565 | 1540 |
1566 | 1541 |
1567 /** | 1542 /** |
1568 * The superclass of all JavaScript values and objects. | 1543 * The superclass of all JavaScript values and objects. |
1569 */ | 1544 */ |
1570 class V8_EXPORT Value : public Data { | 1545 class V8_EXPORT Value : public Data { |
1571 public: | 1546 public: |
1572 /** | 1547 /** |
1573 * Returns true if this value is the undefined value. See ECMA-262 | 1548 * Returns true if this value is the undefined value. See ECMA-262 |
(...skipping 5938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7512 */ | 7487 */ |
7513 | 7488 |
7514 | 7489 |
7515 } // namespace v8 | 7490 } // namespace v8 |
7516 | 7491 |
7517 | 7492 |
7518 #undef TYPE_CHECK | 7493 #undef TYPE_CHECK |
7519 | 7494 |
7520 | 7495 |
7521 #endif // V8_H_ | 7496 #endif // V8_H_ |
OLD | NEW |