Skip to content

Commit df35875

Browse files
committed
fix compiler warnings
1 parent 697d0eb commit df35875

File tree

2 files changed

+23
-55
lines changed

2 files changed

+23
-55
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -85,47 +85,15 @@ RUN echo 'export EM_NODE_JS="$EMSDK_NODE"' >> /etc/bash.bashrc
8585
# List taken from:
8686
# https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix
8787
RUN apt-get update \
88-
&& apt-get install -y \
89-
ca-certificates \
90-
fonts-liberation \
91-
libappindicator3-1 \
92-
libasound2 \
93-
libatk-bridge2.0-0 \
94-
libatk1.0-0 \
95-
libc6 \
96-
libcairo2 \
97-
libcups2 \
98-
libdbus-1-3 \
99-
libexpat1 \
100-
libfontconfig1 \
101-
libgbm1 \
102-
libgcc1 \
103-
libglib2.0-0 \
104-
libgtk-3-0 \
105-
libnspr4 \
106-
libnss3 \
107-
libpango-1.0-0 \
108-
libpangocairo-1.0-0 \
109-
libstdc++6 \
110-
libx11-6 \
111-
libx11-xcb1 \
112-
libxcb1 \
113-
libxcomposite1 \
114-
libxcursor1 \
115-
libxdamage1 \
116-
libxext6 \
117-
libxfixes3 \
118-
libxi6 \
119-
libxrandr2 \
120-
libxrender1 \
121-
libxss1 \
122-
libxtst6 \
123-
lsb-release \
124-
wget \
125-
xdg-utils
126-
127-
# Installs the command "sha3sum", which is used check the download integrity of sqlite source.
128-
RUN apt-get install -y libdigest-sha3-perl
88+
&& apt-get install -y wget gnupg \
89+
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
90+
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
91+
&& apt-get update \
92+
&& apt-get install -y google-chrome-stable fonts-freefont-ttf libxss1 libxshmfence1 libglu1 \
93+
--no-install-recommends \
94+
# Installs the command "sha3sum", which is used check the download integrity of sqlite source.
95+
&& apt-get install -y libdigest-sha3-perl \
96+
&& rm -rf /var/lib/apt/lists/*
12997

13098
# We set this env variable (RUN_WORKER_TEST_WITHOUT_PUPPETEER_SANDBOX=1) this to tell our sql.js test harness to run Puppeteer without the sandbox.
13199
# Otherwise, when we instantiate Puppeteer, we get this error:

src/api.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
279279

280280
/** @typedef {string|number|null|Uint8Array} Database.SqlValue */
281281
/** @typedef {
282-
Database.SqlValue[]|Object<string, Database.SqlValue>|null
282+
Array<Database.SqlValue>|Object<string, Database.SqlValue>|null
283283
} Statement.BindParams
284284
*/
285285

@@ -406,7 +406,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
406406
If the first parameter is not provided, step must have been called before.
407407
@param {Statement.BindParams} [params] If set, the values will be bound
408408
to the statement before it is executed
409-
@return {Database.SqlValue[]} One row of result
409+
@return {Array<Database.SqlValue>} One row of result
410410
411411
@example
412412
<caption>Print all the rows of the table test to the console</caption>
@@ -449,7 +449,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
449449
};
450450

451451
/** Get the list of column names of a row of result of a statement.
452-
@return {string[]} The names of the columns
452+
@return {Array<string>} The names of the columns
453453
@example
454454
var stmt = db.prepare(
455455
"SELECT 5 AS nbr, x'616200' AS data, NULL AS null_value;"
@@ -638,7 +638,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
638638
};
639639

640640
/** Bind values to numbered parameters
641-
@param {Database.SqlValue[]} values
641+
@param {Array<Database.SqlValue>} values
642642
@private
643643
@nodoc
644644
*/
@@ -819,7 +819,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
819819
* @memberof module:SqlJs
820820
* Open a new database either by creating a new one or opening an existing
821821
* one stored in the byte array passed in first argument
822-
* @param {number[]} data An array of bytes representing
822+
* @param {Array<number>} data An array of bytes representing
823823
* an SQLite database file
824824
*/
825825
function Database(data) {
@@ -872,12 +872,12 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
872872

873873
/**
874874
* @typedef {{
875-
columns:string[],
876-
values:Database.SqlValue[][]
875+
columns:Array<string>,
876+
values:Array<Array<Database.SqlValue>>
877877
}} Database.QueryExecResult
878-
* @property {string[]} columns the name of the columns of the result
878+
* @property {Array<string>} columns the name of the columns of the result
879879
* (as returned by {@link Statement.getColumnNames})
880-
* @property {Database.SqlValue[][]} values one array per row, containing
880+
* @property {Array<Array<Database.SqlValue>>} values one array per row, containing
881881
* the column values
882882
*/
883883

@@ -934,7 +934,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
934934
before it is executed. If you use the params argument as an array,
935935
you **cannot** provide an sql string that contains several statements
936936
(separated by `;`). This limitation does not apply to params as an object.
937-
* @return {Database.QueryExecResult[]} The results of each statement
937+
* @return {Array<Database.QueryExecResult>} The results of each statement
938938
*/
939939
Database.prototype["exec"] = function exec(sql, params, config) {
940940
if (!this.db) {
@@ -995,7 +995,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
995995
996996
@param {string} sql A string of SQL text. Can contain placeholders
997997
that will be bound to the parameters given as the second argument
998-
@param {Statement.BindParams} [params=[]] Parameters to bind to the query
998+
@param {Statement.BindParams=} [params=] Parameters to bind to the query
999999
@param {function(Object<string, Database.SqlValue>):void} callback
10001000
Function to call on each row of result
10011001
@param {function():void} done A function that will be called when
@@ -1206,7 +1206,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
12061206
12071207
@param {string} name the name of the function as referenced in
12081208
SQL statements.
1209-
@param {function} func the actual function to be executed.
1209+
@param {function(any)} func the actual function to be executed.
12101210
@return {Database} The database object. Useful for method chaining
12111211
*/
12121212
Database.prototype["create_function"] = function create_function(
@@ -1259,15 +1259,15 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
12591259
SQL statements.
12601260
@param {object} aggregateFunctions
12611261
object containing at least a step function.
1262-
@param {function(): T} [aggregateFunctions.init = ()=>null]
1262+
@param {function(): T} [aggregateFunctions.init=]
12631263
a function receiving no arguments and returning an initial
12641264
value for the aggregate function. The initial value will be
12651265
null if this key is omitted.
12661266
@param {function(T, any) : T} aggregateFunctions.step
12671267
a function receiving the current state and a value to aggregate
12681268
and returning a new state.
12691269
Will receive the value from init for the first step.
1270-
@param {function(T): any} [aggregateFunctions.finalize = (state)=>state]
1270+
@param {function(T): any} [aggregateFunctions.finalize=]
12711271
a function returning the result of the aggregate function
12721272
given its final state.
12731273
If omitted, the value returned by the last step

0 commit comments

Comments
 (0)