Changeset 221622 in webkit for trunk/Source/JavaScriptCore/parser/Nodes.cpp
- Timestamp:
- Sep 5, 2017, 10:43:51 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Nodes.cpp
r218957 r221622 65 65 { 66 66 return m_head == m_tail ? m_head : nullptr; 67 } 68 69 StatementNode* SourceElements::lastStatement() const 70 { 71 return m_tail; 72 } 73 74 bool SourceElements::hasCompletionValue() const 75 { 76 for (StatementNode* statement = m_head; statement; statement = statement->next()) { 77 if (statement->hasCompletionValue()) 78 return true; 79 } 80 81 return false; 82 } 83 84 bool SourceElements::hasEarlyBreakOrContinue() const 85 { 86 for (StatementNode* statement = m_head; statement; statement = statement->next()) { 87 if (statement->isBreak() || statement->isContinue()) 88 return true; 89 if (statement->hasCompletionValue()) 90 return false; 91 } 92 93 return false; 94 } 95 96 // ------------------------------ BlockNode ------------------------------------ 97 98 StatementNode* BlockNode::lastStatement() const 99 { 100 return m_statements ? m_statements->lastStatement() : nullptr; 101 } 102 103 StatementNode* BlockNode::singleStatement() const 104 { 105 return m_statements ? m_statements->singleStatement() : nullptr; 106 } 107 108 bool BlockNode::hasCompletionValue() const 109 { 110 return m_statements ? m_statements->hasCompletionValue() : false; 111 } 112 113 bool BlockNode::hasEarlyBreakOrContinue() const 114 { 115 return m_statements ? m_statements->hasEarlyBreakOrContinue() : false; 67 116 } 68 117 … … 101 150 StatementNode* ScopeNode::singleStatement() const 102 151 { 103 return m_statements ? m_statements->singleStatement() : 0; 152 return m_statements ? m_statements->singleStatement() : nullptr; 153 } 154 155 bool ScopeNode::hasCompletionValue() const 156 { 157 return m_statements ? m_statements->hasCompletionValue() : false; 158 } 159 160 bool ScopeNode::hasEarlyBreakOrContinue() const 161 { 162 return m_statements ? m_statements->hasEarlyBreakOrContinue() : false; 104 163 } 105 164
Note:
See TracChangeset
for help on using the changeset viewer.