From 3274001e079d3a7255167162d4f4fb2c8ef8c22a Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Mon, 1 Sep 2014 08:11:28 -0700 Subject: [PATCH] Remove the deprecated phantom.scriptName. The use of phantom.scriptName has been deprecated since System#args was introduce (version 1.5, March 2012). Any old scripts need to migrate to System#args. https://github.com/ariya/phantomjs/issues/12529 --- src/phantom.cpp | 5 ----- src/phantom.h | 3 --- test/phantom-spec.js | 12 ------------ 3 files changed, 20 deletions(-) diff --git a/src/phantom.cpp b/src/phantom.cpp index 37aac33b..16e3bd04 100644 --- a/src/phantom.cpp +++ b/src/phantom.cpp @@ -251,11 +251,6 @@ void Phantom::setLibraryPath(const QString &libraryPath) m_page->setLibraryPath(libraryPath); } -QString Phantom::scriptName() const -{ - return QFileInfo(m_config.scriptFile()).fileName(); -} - QVariantMap Phantom::version() const { QVariantMap result; diff --git a/src/phantom.h b/src/phantom.h index fd892437..5b7a962c 100644 --- a/src/phantom.h +++ b/src/phantom.h @@ -50,7 +50,6 @@ class Phantom : public QObject Q_PROPERTY(QVariantMap defaultPageSettings READ defaultPageSettings) Q_PROPERTY(QString libraryPath READ libraryPath WRITE setLibraryPath) Q_PROPERTY(QString outputEncoding READ outputEncoding WRITE setOutputEncoding) - Q_PROPERTY(QString scriptName READ scriptName) Q_PROPERTY(QVariantMap version READ version) Q_PROPERTY(QObject *page READ page) Q_PROPERTY(bool cookiesEnabled READ areCookiesEnabled WRITE setCookiesEnabled) @@ -77,8 +76,6 @@ public: QString libraryPath() const; void setLibraryPath(const QString &libraryPath); - QString scriptName() const; - QVariantMap version() const; QObject *page() const; diff --git a/test/phantom-spec.js b/test/phantom-spec.js index a03294d1..2430c0a4 100644 --- a/test/phantom-spec.js +++ b/test/phantom-spec.js @@ -15,18 +15,6 @@ describe("phantom global object", function() { expect(phantom.libraryPath.length).toNotEqual(0); }); - it("should have scriptName property", function() { - expect(phantom.hasOwnProperty('scriptName')).toBeTruthy(); - }); - - it("should have scriptName as a string", function() { - expect(typeof phantom.scriptName).toEqual('string'); - }); - - it("should not have an empty scriptName", function() { - expect(phantom.scriptName.length).toNotEqual(0); - }); - it("should have outputEncoding property", function() { expect(phantom.hasOwnProperty('outputEncoding')).toBeTruthy(); });