Skip to content

Commit 5140f7c

Browse files
committed
remove BsLocalModule for debugger mode as it is no longer needed
1 parent c261190 commit 5140f7c

File tree

7 files changed

+27
-55
lines changed

7 files changed

+27
-55
lines changed

jscomp/core/js_dump.ml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ let dbg_record f =
115115
dbg_block_dot f ;
116116
P.string f L.block_record
117117

118-
let dbg_local_module f =
119-
dbg_block_dot f;
120-
P.string f L.block_local_module
121118

122119
let dbg_poly_var f =
123120
dbg_block_dot f;
@@ -893,13 +890,13 @@ and expression_desc cxt (level:int) f x : cxt =
893890
E.array mutable_flag
894891
(Ext_list.map el drop_comment) ]
895892
)
896-
| Blk_module labels ->
897-
dbg_local_module f;
898-
P.paren_group f 1 (fun _ -> arguments cxt f
899-
[E.array Immutable
900-
(Ext_list.map labels E.str);
901-
E.array mutable_flag
902-
(Ext_list.map el drop_comment)])
893+
| Blk_module labels ->
894+
assert false
895+
(*
896+
This can not happen, see the pattern match on previous branch
897+
TODO: we still need clean up local module compilation
898+
to make it more obvious
899+
*)
903900
| Blk_variant name ->
904901
dbg_poly_var f;
905902
P.paren_group f 1 (fun _ -> arguments cxt f [

jscomp/core/js_dump_lit.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ let caml_block_create = "__"
9090

9191
(** debug symbols *)
9292
let block_record = "record"
93-
let block_local_module = "localModule"
93+
9494
let block_poly_var = "polyVar"
9595
let block_variant = "variant"
9696
let block_simple_variant = "simpleVariant"

jscomp/runtime/caml_chrome_debugger.ml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ var formatter = {
128128
} else if ((recordVariant = x[Symbol.for('BsVariant')]) !== undefined){
129129
return variantPreview(x, recordVariant)
130130
} else if (isOCamlExceptionOrExtension(x)){
131-
return ['div',{}, `${x[0][0]}(…)`]
132-
} else if ((recordModule = x[Symbol.for('BsLocalModule')]) !== undefined){
133-
return ['div', {}, 'Module' ]
131+
return ['div',{}, `${x[0][0]}(…)`]
134132
} else if ((recordPolyVar = x[Symbol.for('BsPolyVar')] ) !== undefined){
135133
return ['div', {}, `\`${recordPolyVar}#${x[0]}`]
136134
}
@@ -147,8 +145,6 @@ var formatter = {
147145
return recordVariant
148146
} else if(isOCamlExceptionOrExtension(x)){
149147
return true
150-
} else if ((recordModule = x[Symbol.for('BsLocalModule')] ) !== undefined){
151-
return true
152148
} else if( (recordPolyVar = x[Symbol.for('BsPolyVar')]) !== undefined){
153149
return true
154150
}
@@ -220,9 +216,6 @@ let simpleVariant meta xs =
220216
setupOnce ();
221217
xs |. addProp (cacheSymbol "BsVariant") [%obj {value = meta }]
222218

223-
let localModule meta xs =
224-
setupOnce ();
225-
xs |. addProp (cacheSymbol "BsLocalModule") [%obj {value = meta}]
226219

227220
let polyVar meta xs =
228221
setupOnce ();

jscomp/runtime/caml_chrome_debugger.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ val variant : 'a -> int -> obj -> obj
3131

3232
val simpleVariant : 'a -> obj -> obj
3333

34-
val localModule : 'a -> obj -> obj
34+
3535

3636
val polyVar : 'a -> obj -> obj

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80345,7 +80345,7 @@ let caml_block_create = "__"
8034580345

8034680346
(** debug symbols *)
8034780347
let block_record = "record"
80348-
let block_local_module = "localModule"
80348+
8034980349
let block_poly_var = "polyVar"
8035080350
let block_variant = "variant"
8035180351
let block_simple_variant = "simpleVariant"
@@ -84381,9 +84381,6 @@ let dbg_record f =
8438184381
dbg_block_dot f ;
8438284382
P.string f L.block_record
8438384383

84384-
let dbg_local_module f =
84385-
dbg_block_dot f;
84386-
P.string f L.block_local_module
8438784384

8438884385
let dbg_poly_var f =
8438984386
dbg_block_dot f;
@@ -85159,13 +85156,13 @@ and expression_desc cxt (level:int) f x : cxt =
8515985156
E.array mutable_flag
8516085157
(Ext_list.map el drop_comment) ]
8516185158
)
85162-
| Blk_module labels ->
85163-
dbg_local_module f;
85164-
P.paren_group f 1 (fun _ -> arguments cxt f
85165-
[E.array Immutable
85166-
(Ext_list.map labels E.str);
85167-
E.array mutable_flag
85168-
(Ext_list.map el drop_comment)])
85159+
| Blk_module labels ->
85160+
assert false
85161+
(*
85162+
This can not happen, see the pattern match on previous branch
85163+
TODO: we still need clean up local module compilation
85164+
to make it more obvious
85165+
*)
8516985166
| Blk_variant name ->
8517085167
dbg_poly_var f;
8517185168
P.paren_group f 1 (fun _ -> arguments cxt f [

lib/4.02.3/whole_compiler.ml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85000,7 +85000,7 @@ let caml_block_create = "__"
8500085000

8500185001
(** debug symbols *)
8500285002
let block_record = "record"
85003-
let block_local_module = "localModule"
85003+
8500485004
let block_poly_var = "polyVar"
8500585005
let block_variant = "variant"
8500685006
let block_simple_variant = "simpleVariant"
@@ -85593,9 +85593,6 @@ let dbg_record f =
8559385593
dbg_block_dot f ;
8559485594
P.string f L.block_record
8559585595

85596-
let dbg_local_module f =
85597-
dbg_block_dot f;
85598-
P.string f L.block_local_module
8559985596

8560085597
let dbg_poly_var f =
8560185598
dbg_block_dot f;
@@ -86371,13 +86368,13 @@ and expression_desc cxt (level:int) f x : cxt =
8637186368
E.array mutable_flag
8637286369
(Ext_list.map el drop_comment) ]
8637386370
)
86374-
| Blk_module labels ->
86375-
dbg_local_module f;
86376-
P.paren_group f 1 (fun _ -> arguments cxt f
86377-
[E.array Immutable
86378-
(Ext_list.map labels E.str);
86379-
E.array mutable_flag
86380-
(Ext_list.map el drop_comment)])
86371+
| Blk_module labels ->
86372+
assert false
86373+
(*
86374+
This can not happen, see the pattern match on previous branch
86375+
TODO: we still need clean up local module compilation
86376+
to make it more obvious
86377+
*)
8638186378
| Blk_variant name ->
8638286379
dbg_poly_var f;
8638386380
P.paren_group f 1 (fun _ -> arguments cxt f [

lib/js/caml_chrome_debugger.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ var formatter = {
106106
} else if ((recordVariant = x[Symbol.for('BsVariant')]) !== undefined){
107107
return variantPreview(x, recordVariant)
108108
} else if (isOCamlExceptionOrExtension(x)){
109-
return ['div',{}, `${x[0][0]}(…)`]
110-
} else if ((recordModule = x[Symbol.for('BsLocalModule')]) !== undefined){
111-
return ['div', {}, 'Module' ]
109+
return ['div',{}, `${x[0][0]}(…)`]
112110
} else if ((recordPolyVar = x[Symbol.for('BsPolyVar')] ) !== undefined){
113111
return ['div', {}, `\`${recordPolyVar}#${x[0]}`]
114112
}
@@ -125,8 +123,6 @@ var formatter = {
125123
return recordVariant
126124
} else if(isOCamlExceptionOrExtension(x)){
127125
return true
128-
} else if ((recordModule = x[Symbol.for('BsLocalModule')] ) !== undefined){
129-
return true
130126
} else if( (recordPolyVar = x[Symbol.for('BsPolyVar')]) !== undefined){
131127
return true
132128
}
@@ -199,13 +195,6 @@ function simpleVariant(meta, xs) {
199195
});
200196
}
201197

202-
function localModule(meta, xs) {
203-
setupOnce(/* () */0);
204-
return Object.defineProperty(xs, Symbol.for("BsLocalModule"), {
205-
value: meta
206-
});
207-
}
208-
209198
function polyVar(meta, xs) {
210199
setupOnce(/* () */0);
211200
return Object.defineProperty(xs, Symbol.for("BsPolyVar"), {
@@ -219,6 +208,5 @@ exports.__ = __;
219208
exports.record = record;
220209
exports.variant = variant;
221210
exports.simpleVariant = simpleVariant;
222-
exports.localModule = localModule;
223211
exports.polyVar = polyVar;
224212
/* No side effect */

0 commit comments

Comments
 (0)