/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
return m_provider->getRange(m_startChar, m_endChar);
}
+ CString toUTF8() const;
+
intptr_t providerID() const
{
if (!m_provider)
SourceCode subExpression(unsigned openBrace, unsigned closeBrace, int firstLine, int startColumn);
+#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
+ SourceCode subArrowExpression(unsigned startArrowFunction, unsigned endArrowFunction, int firstLine, int startColumn);
+#endif
private:
RefPtr<SourceProvider> m_provider;
int m_startChar;
{
return SourceCode(StringSourceProvider::create(source, url, startPosition), startPosition.m_line.oneBasedInt(), startPosition.m_column.oneBasedInt());
}
+
+#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
+ inline SourceCode SourceCode::subArrowExpression(unsigned startArrowFunction, unsigned endArrowFunction, int firstLine, int startColumn)
+ {
+ ASSERT(provider()->source()[startArrowFunction] == '=' && provider()->source()[startArrowFunction + 1] == '>');
+
+ startColumn += 1; // Convert to base 1.
+ return SourceCode(provider(), startArrowFunction, endArrowFunction, firstLine, startColumn);
+ }
+#endif
inline SourceCode SourceCode::subExpression(unsigned openBrace, unsigned closeBrace, int firstLine, int startColumn)
{