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 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 /** | 1535 /** |
1536 * Representation of a JavaScript stack trace. The information collected is a | 1536 * Representation of a JavaScript stack trace. The information collected is a |
1537 * snapshot of the execution stack and the information remains valid after | 1537 * snapshot of the execution stack and the information remains valid after |
1538 * execution continues. | 1538 * execution continues. |
1539 */ | 1539 */ |
1540 class V8_EXPORT StackTrace { | 1540 class V8_EXPORT StackTrace { |
1541 public: | 1541 public: |
1542 /** | 1542 /** |
1543 * Flags that determine what information is placed captured for each | 1543 * Flags that determine what information is placed captured for each |
1544 * StackFrame when grabbing the current stack trace. | 1544 * StackFrame when grabbing the current stack trace. |
| 1545 * Note: these options are deprecated and we always collect all available |
| 1546 * information (kDetailed). |
1545 */ | 1547 */ |
1546 enum StackTraceOptions { | 1548 enum StackTraceOptions { |
1547 kLineNumber = 1, | 1549 kLineNumber = 1, |
1548 kColumnOffset = 1 << 1 | kLineNumber, | 1550 kColumnOffset = 1 << 1 | kLineNumber, |
1549 kScriptName = 1 << 2, | 1551 kScriptName = 1 << 2, |
1550 kFunctionName = 1 << 3, | 1552 kFunctionName = 1 << 3, |
1551 kIsEval = 1 << 4, | 1553 kIsEval = 1 << 4, |
1552 kIsConstructor = 1 << 5, | 1554 kIsConstructor = 1 << 5, |
1553 kScriptNameOrSourceURL = 1 << 6, | 1555 kScriptNameOrSourceURL = 1 << 6, |
1554 kScriptId = 1 << 7, | 1556 kScriptId = 1 << 7, |
1555 kExposeFramesAcrossSecurityOrigins = 1 << 8, | 1557 kExposeFramesAcrossSecurityOrigins = 1 << 8, |
1556 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName, | 1558 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName, |
1557 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL | 1559 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL |
1558 }; | 1560 }; |
1559 | 1561 |
1560 /** | 1562 /** |
1561 * Returns a StackFrame at a particular index. | 1563 * Returns a StackFrame at a particular index. |
1562 */ | 1564 */ |
1563 Local<StackFrame> GetFrame(uint32_t index) const; | 1565 Local<StackFrame> GetFrame(uint32_t index) const; |
1564 | 1566 |
1565 /** | 1567 /** |
1566 * Returns the number of StackFrames. | 1568 * Returns the number of StackFrames. |
1567 */ | 1569 */ |
1568 int GetFrameCount() const; | 1570 int GetFrameCount() const; |
1569 | 1571 |
1570 /** | 1572 /** |
1571 * Returns StackTrace as a v8::Array that contains StackFrame objects. | 1573 * Returns StackTrace as a v8::Array that contains StackFrame objects. |
1572 */ | 1574 */ |
1573 Local<Array> AsArray(); | 1575 V8_DEPRECATED("Use native API instead", Local<Array> AsArray()); |
1574 | 1576 |
1575 /** | 1577 /** |
1576 * Grab a snapshot of the current JavaScript execution stack. | 1578 * Grab a snapshot of the current JavaScript execution stack. |
1577 * | 1579 * |
1578 * \param frame_limit The maximum number of stack frames we want to capture. | 1580 * \param frame_limit The maximum number of stack frames we want to capture. |
1579 * \param options Enumerates the set of things we will capture for each | 1581 * \param options Enumerates the set of things we will capture for each |
1580 * StackFrame. | 1582 * StackFrame. |
1581 */ | 1583 */ |
1582 static Local<StackTrace> CurrentStackTrace( | 1584 static Local<StackTrace> CurrentStackTrace( |
1583 Isolate* isolate, | 1585 Isolate* isolate, int frame_limit, StackTraceOptions options = kDetailed); |
1584 int frame_limit, | |
1585 StackTraceOptions options = kOverview); | |
1586 }; | 1586 }; |
1587 | 1587 |
1588 | 1588 |
1589 /** | 1589 /** |
1590 * A single JavaScript stack frame. | 1590 * A single JavaScript stack frame. |
1591 */ | 1591 */ |
1592 class V8_EXPORT StackFrame { | 1592 class V8_EXPORT StackFrame { |
1593 public: | 1593 public: |
1594 /** | 1594 /** |
1595 * Returns the number, 1-based, of the line for the associate function call. | 1595 * Returns the number, 1-based, of the line for the associate function call. |
(...skipping 8404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10000 */ | 10000 */ |
10001 | 10001 |
10002 | 10002 |
10003 } // namespace v8 | 10003 } // namespace v8 |
10004 | 10004 |
10005 | 10005 |
10006 #undef TYPE_CHECK | 10006 #undef TYPE_CHECK |
10007 | 10007 |
10008 | 10008 |
10009 #endif // INCLUDE_V8_H_ | 10009 #endif // INCLUDE_V8_H_ |
OLD | NEW |