File tree 3 files changed +121
-51
lines changed
3 files changed +121
-51
lines changed Original file line number Diff line number Diff line change 5
5
"description" : " The Source Map specification" ,
6
6
"scripts" : {
7
7
"prebuild-only" : " npm run clean && mkdir out && cp -R img out" ,
8
- "build-only" : " ecmarkup --verbose --load-biblio @tc39/ecma262-biblio spec.emu out/index.html" ,
9
- "build" : " npm run build-only" ,
8
+ "build-only" : " npm run ecmarkup -- --verbose --load-biblio @tc39/ecma262-biblio spec.emu out/index.html" ,
9
+ "build-loose" : " npm run build-only" ,
10
+ "build" : " npm run build-only -- --lint-spec" ,
10
11
"clean" : " rm -rf out" ,
12
+ "ecmarkup" : " node ./scripts/ecmarkup.js" ,
11
13
"format" : " emu-format --write spec.emu" ,
12
14
"test" : " exit 0" ,
13
15
"watch" : " npm run build-only -- --watch"
Original file line number Diff line number Diff line change
1
+ function wrapWarnFunction ( originalWarn ) {
2
+ return ( err ) => {
3
+ if (
4
+ err . message . includes ( "Completion Record" ) ||
5
+ err . message . includes ( "an abrupt completion" )
6
+ ) {
7
+ // Ignore errors about completion records
8
+ return ;
9
+ }
10
+
11
+ let match ;
12
+ if ( match = / ^ c o u l d n o t f i n d d e f i n i t i o n f o r ( \w + ) $ / . exec ( err . message ) ) {
13
+ switch ( match [ 1 ] ) {
14
+ // This is correctly <dfn>ed as a reference from an external
15
+ // specification. However, ecmarkup only allows "calling" AOs and not
16
+ // <dfn>ed terms.
17
+ case "module_decode" :
18
+ // Ecmarkup mistakenly detects HTTP in "an HTTP(S) scheme" as an AO
19
+ // call.
20
+ case "HTTP" :
21
+ return ;
22
+ }
23
+ }
24
+
25
+ originalWarn ( err ) ;
26
+ } ;
27
+ }
28
+
29
+ Object . defineProperty ( Object . prototype , "warn" , {
30
+ enumerable : false ,
31
+ configurable : true ,
32
+ get : ( ) => undefined ,
33
+ set ( value ) {
34
+ // Trying to detect this object:
35
+ // https://github.com/tc39/ecmarkup/blob/734baa009be2bdbab29c14a9e52ed3da1e26caa3/src/cli.ts#L104
36
+ if (
37
+ Object . hasOwn ( this , "multipage" ) &&
38
+ Object . hasOwn ( this , "outfile" ) &&
39
+ Object . hasOwn ( this , "extraBiblios" ) &&
40
+ Object . hasOwn ( this , "lintSpec" )
41
+ ) {
42
+ value = wrapWarnFunction ( value ) ;
43
+ }
44
+ Object . defineProperty ( this , "warn" , {
45
+ enumerable : true ,
46
+ configurable : true ,
47
+ writable : true ,
48
+ value,
49
+ } ) ;
50
+ } ,
51
+ } ) ;
52
+
53
+ require ( "ecmarkup/bin/ecmarkup.js" ) ;
You can’t perform that action at this time.
0 commit comments