Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / resources / script-line-number.js
blob178be5b7e4bd54e1aab5ad0a3cb11903c072a3b2
1 description(
2 "This test checks that line numbers are correctly reported for both inline scripts and inline event handlers."
3 );
5 function getLineFromError(e)
7 // JSC
8 if (e.line)
9 return e.line;
11 // V8
12 if (e.stack) {
13 // ErrorName: ErrorDescription at FileName:LineNumber:ColumnNumber
14 parts = e.stack.split(":");
15 return parts[parts.length - 2];
18 return -1;
21 function assertErrorOnLine(error, expectedLine)
23 shouldBe(stringify(getLineFromError(error)), stringify(expectedLine));