| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,11 +1,26 @@ | |||
| 1 | 1 | // Flags: --enable-source-maps | |
| 2 | 2 | 'use strict'; | |
| 3 | 3 | ||
| 4 | - require('../common'); | ||
| 4 | + const common = require('../common'); | ||
| 5 | 5 | const assert = require('assert'); | |
| 6 | 6 | const { findSourceMap, SourceMap } = require('module'); | |
| 7 | 7 | const { readFileSync } = require('fs'); | |
| 8 | 8 | ||
| 9 | + // It should throw with invalid args. | ||
| 10 | + { | ||
| 11 | + [1, true, 'foo'].forEach((invalidArg) => | ||
| 12 | + assert.throws( | ||
| 13 | + () => new SourceMap(invalidArg), | ||
| 14 | + { | ||
| 15 | + code: 'ERR_INVALID_ARG_TYPE', | ||
| 16 | + name: 'TypeError', | ||
| 17 | + message: 'The "payload" argument must be of type object.' + | ||
| 18 | + common.invalidArgTypeHelper(invalidArg) | ||
| 19 | + } | ||
| 20 | + ) | ||
| 21 | + ); | ||
| 22 | + } | ||
| 23 | + | ||
| 9 | 24 | // findSourceMap() can lookup source-maps based on URIs, in the | |
| 10 | 25 | // non-exceptional case. | |
| 11 | 26 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments