DeprecationReportBody: columnNumber property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Note: This feature is available inWeb Workers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
ThecolumnNumber read-only property of theDeprecationReportBody interface returns the line in the source file in which the deprecated feature was used.
Note:This property is most useful alongsideDeprecationReportBody.sourceFile andDeprecationReportBody.lineNumber as it enables the location of the column in that file and line where the error occurred.
In this article
Value
An integer, ornull if the column is not known.
Examples
In this example we create a newReportingObserver to observe deprecation reports, then print the value ofcolumnNumber to the console.
let options = { types: ["deprecation"], buffered: true,};let observer = new ReportingObserver((reports, observer) => { let firstReport = reports[0]; console.log(firstReport.type); // deprecation console.log(firstReport.body.sourceFile); // the source file console.log(firstReport.body.lineNumber); // the line in that file console.log(firstReport.body.columnNumber); // the column in that file.}, options);Specifications
| Specification |
|---|
| Deprecation Reporting> # dom-deprecationreportbody-columnnumber> |