Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Update Standard@9.0.0 #7817

Merged
merged 2 commits into from
Apr 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/dataFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports.readDataFile = (resourceName, url) => {
fs.readFile(storagePath(url), (err, data) => {
if (err || !data || data.length === 0) {
// console.log('rejecting for read for resource:', resourceName)
reject()
reject(new Error('unable to read data file'))
} else {
// console.log('resolving for read for resource:', resourceName)
resolve(data)
Expand Down
5 changes: 4 additions & 1 deletion app/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ var isoWeek = function () {
date.setHours(0, 0, 0, 0)
date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7))
var jan4 = new Date(date.getFullYear(), 0, 4)
return 1 + Math.round((((date.getTime() - jan4.getTime()) / 86400000) - 3 + ((jan4.getDay() + 6) % 7) / 7))
return 1 + Math.round(
((date.getTime() - jan4.getTime()) / 86400000) - 3 +
(((jan4.getDay() + 6) % 7) / 7)
)
}

// Local data yyyy-mm-dd (with zero padding)
Expand Down
2 changes: 1 addition & 1 deletion app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ var recoverKeys = (appState, action) => {
secondRecoveryKey = action.secondRecoveryKey
}

const UUID_REGEX = /^[0-9a-z]{8}\-[0-9a-z]{4}\-[0-9a-z]{4}\-[0-9a-z]{4}\-[0-9a-z]{12}$/
const UUID_REGEX = /^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$/
if (typeof firstRecoveryKey !== 'string' || !firstRecoveryKey.match(UUID_REGEX) || typeof secondRecoveryKey !== 'string' || !secondRecoveryKey.match(UUID_REGEX)) {
// calling logError sets the error object
logError(true, 'recoverKeys')
Expand Down
1 change: 0 additions & 1 deletion app/renderer/components/bookmarksToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class BookmarkToolbarButton extends ImmutableComponent {
if (this.isFolder) {
e.target = ReactDOM.findDOMNode(this)
if (dnd.isMiddle(e.target, e.clientX)) {
e.target.getBoundingClientRect
this.props.showBookmarkFolderMenu(this.props.bookmark, e)
windowActions.setIsBeingDraggedOverDetail(dragTypes.BOOKMARK, this.props.bookmark, {
expanded: true
Expand Down
1 change: 0 additions & 1 deletion app/renderer/components/browserAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const electron = require('electron')
const ipc = electron.ipcRenderer
const Button = require('../../../js/components/button')
const BrowserActionBadge = require('../../renderer/components/browserActionBadge')
const cx = require('../../../js/lib/classSet')
const extensionState = require('../../common/state/extensionState')
const windowActions = require('../../../js/actions/windowActions')
const {StyleSheet, css} = require('aphrodite')
Expand Down
4 changes: 0 additions & 4 deletions app/renderer/components/tabContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ class AudioTabIcon extends ImmutableComponent {
return this.pageCanPlayAudio && this.props.tab.get('audioMuted')
}

get unmutedState () {
this.props.tab.get('audioPlaybackActive') && !this.props.tab.get('audioMuted')
}

get audioIcon () {
return !this.mutedState
? globalStyles.appIcons.volumeOn
Expand Down
2 changes: 1 addition & 1 deletion js/lib/imageUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports.getBase64FromImageUrl = (url) => {
return new Promise((resolve, reject) => {
const img = new window.Image()
img.onerror = function () {
reject()
reject(new Error('unable to load image'))
}
img.onload = function () {
const canvas = document.createElement('canvas')
Expand Down
6 changes: 3 additions & 3 deletions js/lib/urlutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ const UrlUtil = {
return true
}
// for cases where we have scheme and we dont want spaces in domain names
const caseDomain = /^[\w]{2,5}:\/\/[^\s\/]+\//
const caseDomain = /^[\w]{2,5}:\/\/[^\s/]+\//
// for cases, quoted strings
const case1Reg = /^".*"$/
// for cases:
// - starts with "?" or "."
// - contains "? "
// - ends with "." (and was not preceded by a domain or /)
const case2Reg = /(^\?)|(\?.+\s)|(^\.)|(^[^.+\..+]*[^\/]*\.$)/
const case2Reg = /(^\?)|(\?.+\s)|(^\.)|(^[^.+..+]*[^/]*\.$)/
// for cases, pure string
const case3Reg = /[\?\.\/\s:]/
const case3Reg = /[?./\s:]/
// for cases, data:uri, view-source:uri and about
const case4Reg = /^(data|view-source|mailto|about|chrome-extension|magnet):.*/

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"sinon": "^1.17.6",
"spectron": "brave/spectron#chromium56",
"sqlite3": "^3.1.1",
"standard": "8.1.0",
"standard": "9.0.0",
"style-loader": "^0.13.0",
"uglify-js-harmony": "^2.7.5",
"webdriverio": "4.2.5",
Expand Down
2 changes: 1 addition & 1 deletion test/about/ledgerPanelAdvancedPanelTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function validateRecoveryFile (recoveryFileContents) {
console.log(`recovered passphrase: ${passphrase}`)

// validate that paymentId and passphrase are uuids here
const UUID_REGEX = /^[0-9a-z]{8}\-[0-9a-z]{4}\-[0-9a-z]{4}\-[0-9a-z]{4}\-[0-9a-z]{12}$/
const UUID_REGEX = /^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$/
assert.ok(paymentId.match(UUID_REGEX), 'paymentId should be a valid UUID')
assert.ok(passphrase.match(UUID_REGEX), 'passphrase should be a valid UUID')

Expand Down
2 changes: 1 addition & 1 deletion test/lib/brave.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ var exports = {
// Get the internal view instance ID from the selected webview
var v8Util = process.atomBinding('v8_util')
var internal = v8Util.getHiddenValue(webview, 'internal')
internal.viewInstanceId

// This allows you to send more args than just the event itself like would only
// be possible with dispatchEvent.
devTools('electron').ipcRenderer.emit('ELECTRON_GUEST_VIEW_INTERNAL_DISPATCH_EVENT-' + internal.viewInstanceId, ...params)
Expand Down
2 changes: 1 addition & 1 deletion test/misc-components/syncTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function * setupBrave (client) {
}

function * toggleSync (client, expectedState) {
if (typeof expectedState === undefined) {
if (typeof expectedState === 'undefined') {
throw new Error('expectedState is required')
}
yield client
Expand Down
3 changes: 1 addition & 2 deletions test/unit/about/newTabPageTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ describe('NewTab component unit tests', function () {
describe('randomBackgroundImage', function () {
it('calls random to get a random index', function () {
randomSpy.reset()
const instance = wrapper.instance()
instance.randomBackgroundImage
wrapper.instance().randomBackgroundImage
assert.equal(randomSpy.calledOnce, true)
})

Expand Down
2 changes: 1 addition & 1 deletion tools/lib/transactionHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let generateRandomHost = require('./randomHostname')
const SATOSHIS_PER_BTC = Math.pow(10, 8)

const VALID_CURRENCY_CODE_REGEX = /^[A-Z]+$/
const VALID_HOSTNAME_REGEX = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/
const VALID_HOSTNAME_REGEX = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/

const transactionSchema = Joi.object().keys({
viewingId: Joi.string().guid().required().description('a unique id for the transaction'),
Expand Down