Browse Source

fixing linter issues.

ali.ibrahim 8 years ago
parent
commit
ae1c33b863
3 changed files with 420 additions and 429 deletions
  1. 1 1
      atom/browser/api/atom_api_url_request.cc
  2. 13 14
      lib/browser/api/net.js
  3. 406 414
      spec/api-net-spec.js

+ 1 - 1
atom/browser/api/atom_api_url_request.cc

@@ -334,7 +334,7 @@ void URLRequest::OnAuthenticationRequired(
   if (!atom_request_) {
     return;
   }
-  
+
   EmitRequestEvent(
     false,
     "login",

+ 13 - 14
lib/browser/api/net.js

@@ -19,8 +19,8 @@ class IncomingMessage extends Readable {
   constructor (urlRequest) {
     super()
     this._url_request = urlRequest
-    this._shouldPush = false;
-    this._data = [];
+    this._shouldPush = false
+    this._data = []
     this._url_request.on('data', (event, chunk) => {
       this._storeInternalData(chunk)
       this._pushInternalData()
@@ -59,26 +59,26 @@ class IncomingMessage extends Readable {
     return this._url_request.rawResponseHeaders
   }
 
-  get rawTrailers() {
-    throw (new Error('HTTP trailers are not supported.'))
+  get rawTrailers () {
+    throw new Error('HTTP trailers are not supported.')
   }
 
-  get trailers() {
-    throw (new Error('HTTP trailers are not supported.'))
+  get trailers () {
+    throw new Error('HTTP trailers are not supported.')
   }
 
-  _storeInternalData(chunk) {
+  _storeInternalData (chunk) {
     this._data.push(chunk)
   }
 
-  _pushInternalData() {
+  _pushInternalData () {
     while (this._shouldPush && this._data.length > 0) {
-        const chunk = this._data.shift()
-        this._shouldPush = this.push(chunk)
+      const chunk = this._data.shift()
+      this._shouldPush = this.push(chunk)
     }
   }
 
-  _read() {
+  _read () {
     this._shouldPush = true
     this._pushInternalData()
   }
@@ -141,7 +141,6 @@ class ClientRequest extends EventEmitter {
         }
       }
 
-
       if (options.path && / /.test(options.path)) {
         // The actual regex is more like /[^A-Za-z0-9\-._~!$&'()*+,;=/:@]/
         // with an additional rule for ignoring percentage-escaped characters
@@ -150,9 +149,9 @@ class ClientRequest extends EventEmitter {
         // why it only scans for spaces because those are guaranteed to create
         // an invalid request.
         throw new TypeError('Request path contains unescaped characters.')
-      } 
+      }
       let pathObj = url.parse(options.path || '/')
-      urlObj.pathname =  pathObj.pathname
+      urlObj.pathname = pathObj.pathname
       urlObj.search = pathObj.search
       urlObj.hash = pathObj.hash
       urlStr = url.format(urlObj)

File diff suppressed because it is too large
+ 406 - 414
spec/api-net-spec.js


Some files were not shown because too many files changed in this diff