aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/qmljsbind.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2019-07-31 17:21:41 +0200
committerhjk <[email protected]>2019-08-01 13:20:26 +0000
commit2e14df7561ee10c7a408bd3ebb4944016ecdd1f4 (patch)
tree4a220241720e8a307fb96e98941656cf7b9f940d /src/libs/qmljs/qmljsbind.cpp
parent630385751a806b64d41295ee50957e2a9138a193 (diff)
Some clang-tidy -use-modernize-nullptr
Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204 Reviewed-by: Thomas Hartmann <[email protected]>
Diffstat (limited to 'src/libs/qmljs/qmljsbind.cpp')
-rw-r--r--src/libs/qmljs/qmljsbind.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libs/qmljs/qmljsbind.cpp b/src/libs/qmljs/qmljsbind.cpp
index 6b904da0408..70912cdf211 100644
--- a/src/libs/qmljs/qmljsbind.cpp
+++ b/src/libs/qmljs/qmljsbind.cpp
@@ -53,9 +53,9 @@ using namespace QmlJS::AST;
Bind::Bind(Document *doc, QList<DiagnosticMessage> *messages, bool isJsLibrary, const QList<ImportInfo> &jsImports)
: _doc(doc),
- _currentObjectValue(0),
- _idEnvironment(0),
- _rootObjectValue(0),
+ _currentObjectValue(nullptr),
+ _idEnvironment(nullptr),
+ _rootObjectValue(nullptr),
_isJsLibrary(isJsLibrary),
_imports(jsImports),
_diagnosticMessages(messages)
@@ -134,7 +134,7 @@ ObjectValue *Bind::switchObjectValue(ObjectValue *newObjectValue)
ObjectValue *Bind::bindObject(UiQualifiedId *qualifiedTypeNameId, UiObjectInitializer *initializer)
{
- ObjectValue *parentObjectValue = 0;
+ ObjectValue *parentObjectValue = nullptr;
// normal component instance
ASTObjectValue *objectValue = new ASTObjectValue(qualifiedTypeNameId, initializer, _doc, &_valueOwner);
@@ -169,13 +169,13 @@ void Bind::accept(Node *node)
bool Bind::visit(AST::UiProgram *)
{
- _idEnvironment = _valueOwner.newObject(/*prototype =*/ 0);
+ _idEnvironment = _valueOwner.newObject(/*prototype =*/ nullptr);
return true;
}
bool Bind::visit(AST::Program *)
{
- _currentObjectValue = _valueOwner.newObject(/*prototype =*/ 0);
+ _currentObjectValue = _valueOwner.newObject(/*prototype =*/ nullptr);
_rootObjectValue = _currentObjectValue;
return true;
}
@@ -236,7 +236,7 @@ bool Bind::visit(UiPublicMember *ast)
const Block *block = AST::cast<const Block*>(ast->statement);
if (block) {
// build block scope
- ObjectValue *blockScope = _valueOwner.newObject(/*prototype=*/0);
+ ObjectValue *blockScope = _valueOwner.newObject(/*prototype=*/nullptr);
_attachedJSScopes.insert(ast, blockScope); // associated with the UiPublicMember, not with the block
ObjectValue *parent = switchObjectValue(blockScope);
accept(ast->statement);
@@ -259,7 +259,7 @@ bool Bind::visit(UiObjectDefinition *ast)
_qmlObjects.insert(ast, value);
} else {
_groupedPropertyBindings.insert(ast);
- ObjectValue *oldObjectValue = switchObjectValue(0);
+ ObjectValue *oldObjectValue = switchObjectValue(nullptr);
accept(ast->initializer);
switchObjectValue(oldObjectValue);
}
@@ -289,7 +289,7 @@ bool Bind::visit(UiScriptBinding *ast)
const Block *block = AST::cast<const Block*>(ast->statement);
if (block) {
// build block scope
- ObjectValue *blockScope = _valueOwner.newObject(/*prototype=*/0);
+ ObjectValue *blockScope = _valueOwner.newObject(/*prototype=*/nullptr);
_attachedJSScopes.insert(ast, blockScope); // associated with the UiScriptBinding, not with the block
ObjectValue *parent = switchObjectValue(blockScope);
accept(ast->statement);
@@ -328,7 +328,7 @@ bool Bind::visit(FunctionExpression *ast)
_currentObjectValue->setMember(ast->name.toString(), function);
// build function scope
- ObjectValue *functionScope = _valueOwner.newObject(/*prototype=*/0);
+ ObjectValue *functionScope = _valueOwner.newObject(/*prototype=*/nullptr);
_attachedJSScopes.insert(ast, functionScope);
ObjectValue *parent = switchObjectValue(functionScope);
@@ -345,7 +345,7 @@ bool Bind::visit(FunctionExpression *ast)
// ### TODO, currently covered by the accept(body)
// 3. Arguments object
- ObjectValue *arguments = _valueOwner.newObject(/*prototype=*/0);
+ ObjectValue *arguments = _valueOwner.newObject(/*prototype=*/nullptr);
arguments->setMember(QLatin1String("callee"), function);
arguments->setMember(QLatin1String("length"), _valueOwner.numberValue());
functionScope->setMember(QLatin1String("arguments"), arguments);