mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 05:34:21 +08:00
This change updated the postcss package from 8.4.5 to 8.4.38 and the dependent package nanoid package from 3.1.30 to 3.3.7 to fix the vulnerability related to the two packages. I have to use the `npm audit fix --force` to update the two packages instead of `npm run install-deps audit-fix --audit-level=critical` due to an error tracked in https://issues.chromium.org/issues/343248814 Bug: 343248812 Change-Id: I5e8a8b7a0515d3610ac2ab5f999f99fed8893da0 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5577438 Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Reviewed-by: Simon Zünd <szuend@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
38 lines
739 B
JavaScript
38 lines
739 B
JavaScript
'use strict'
|
|
|
|
class Warning {
|
|
constructor(text, opts = {}) {
|
|
this.type = 'warning'
|
|
this.text = text
|
|
|
|
if (opts.node && opts.node.source) {
|
|
let range = opts.node.rangeBy(opts)
|
|
this.line = range.start.line
|
|
this.column = range.start.column
|
|
this.endLine = range.end.line
|
|
this.endColumn = range.end.column
|
|
}
|
|
|
|
for (let opt in opts) this[opt] = opts[opt]
|
|
}
|
|
|
|
toString() {
|
|
if (this.node) {
|
|
return this.node.error(this.text, {
|
|
index: this.index,
|
|
plugin: this.plugin,
|
|
word: this.word
|
|
}).message
|
|
}
|
|
|
|
if (this.plugin) {
|
|
return this.plugin + ': ' + this.text
|
|
}
|
|
|
|
return this.text
|
|
}
|
|
}
|
|
|
|
module.exports = Warning
|
|
Warning.default = Warning
|