@@ -73,7 +73,8 @@ export type DataSchemaCompilerOptions = {
7373 nativeInstance : NativeInstance ;
7474 cubeFactory : Function ;
7575 cubeDictionary : CubeDictionary ;
76- cubeSymbols : CubeSymbols ;
76+ cubeOnlySymbols : CubeSymbols ;
77+ cubeAndViewSymbols : CubeSymbols ;
7778 cubeCompilers ?: CompilerInterface [ ] ;
7879 contextCompilers ?: CompilerInterface [ ] ;
7980 transpilers ?: TranspilerInterface [ ] ;
@@ -131,7 +132,9 @@ export class DataSchemaCompiler {
131132
132133 private readonly cubeDictionary : CubeDictionary ;
133134
134- private readonly cubeSymbols : CubeSymbols ;
135+ private readonly cubeOnlySymbols : CubeSymbols ;
136+
137+ private readonly cubeAndViewSymbols : CubeSymbols ;
135138
136139 // Actually should be something like
137140 // createCube(cubeDefinition: CubeDefinition): CubeDefinitionExtended
@@ -187,7 +190,8 @@ export class DataSchemaCompiler {
187190 this . cubeNameCompilers = options . cubeNameCompilers || [ ] ;
188191 this . extensions = options . extensions || { } ;
189192 this . cubeDictionary = options . cubeDictionary ;
190- this . cubeSymbols = options . cubeSymbols ;
193+ this . cubeOnlySymbols = options . cubeOnlySymbols ;
194+ this . cubeAndViewSymbols = options . cubeAndViewSymbols ;
191195 this . cubeFactory = options . cubeFactory ;
192196 this . filesToCompile = options . filesToCompile || [ ] ;
193197 this . omitErrors = options . omitErrors || false ;
@@ -531,7 +535,8 @@ export class DataSchemaCompiler {
531535 // Free unneeded resources
532536 this . compileV8ContextCache = null ;
533537 this . cubeDictionary . free ( ) ;
534- this . cubeSymbols . free ( ) ;
538+ this . cubeOnlySymbols . free ( ) ;
539+ this . cubeAndViewSymbols . free ( ) ;
535540 return res ;
536541 } ) ;
537542 }
@@ -564,7 +569,9 @@ export class DataSchemaCompiler {
564569 // which doesn't allow passing any function objects, so we need to sanitize the symbols.
565570 // Communication with native backend also involves deserialization.
566571 const cubeSymbols : Record < string , Record < string , boolean > > = Object . fromEntries (
567- Object . entries ( this . cubeSymbols . symbols as Record < string , Record < string , any > > )
572+ [ ...Object . entries ( this . cubeOnlySymbols . symbols as Record < string , Record < string , any > > ) ,
573+ ...Object . entries ( this . cubeAndViewSymbols . symbols as Record < string , Record < string , any > > )
574+ ]
568575 . map (
569576 ( [ key , value ] : [ string , Record < string , any > ] ) => [ key , Object . fromEntries (
570577 Object . keys ( value ) . map ( ( k ) => [ k , true ] ) ,
0 commit comments