diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-08-17 17:04:58 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-08-23 08:25:09 +0000 |
commit | 6c19708039d0553cf79c68ff00ad1415f7d826e0 (patch) | |
tree | 6250f6d0d1451bfeaee4517e67f303d074c3148f /tests/auto/blackbox/testdata/jsextensions-textfile | |
parent | aae7f0e4eee7d38d590f203b87f3aff41a2b1940 (diff) |
Remove the need for calling TextFile.close()
It's very easy to forget to close an opened TextFile, and the widely
used boiler-plate finally blocks are not the most beautiful thing to
behold.
Remove the need for calling TextFile.close() by making sure we
automatically close files when we finish evaluating a chunk of
JavaScript.
[ChangeLog] TextFile objects are automatically closed after
the current script execution is finished.
Change-Id: I2bd8639951f4fa5ef797785952911accf33afded
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata/jsextensions-textfile')
-rw-r--r-- | tests/auto/blackbox/testdata/jsextensions-textfile/textfile.qbs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/blackbox/testdata/jsextensions-textfile/textfile.qbs b/tests/auto/blackbox/testdata/jsextensions-textfile/textfile.qbs index 0687adf88..ef433a1e4 100644 --- a/tests/auto/blackbox/testdata/jsextensions-textfile/textfile.qbs +++ b/tests/auto/blackbox/testdata/jsextensions-textfile/textfile.qbs @@ -16,7 +16,7 @@ Product { cmd.sourceCode = function() { var file1 = new TextFile("file1.txt", TextFile.WriteOnly); file1.write("First line.\n"); - file1.close(); + // Do not close the file to test the auto close functionality. }; commands.push(cmd); cmd = new JavaScriptCommand(); |