File: use-local-js-files

package info (click to toggle)
prettify.js 2015.12.04%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 796 kB
  • sloc: perl: 113; makefile: 107; sh: 54
file content (44 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: Use local js files
 Using Debian tools is fine, except when some files are missing (See #755468). 
 .
 When the above bug is fixed, just remove this patch.
Author: dod
Applied-Upstream: NA
--- /dev/null
+++ b/amd-externs.js
@@ -0,0 +1,8 @@
+/**
+ * @param {string} id
+ * @param {Array.<string>} dependencies
+ * @param {Function} factory
+ */
+function define(id, dependencies, factory) {}
+/** @type {*} */
+define.amd;
--- /dev/null
+++ b/console-externs.js
@@ -0,0 +1,5 @@
+var console = {};
+/**
+ * @param {string} message
+ */
+console.warn = function (message, var_args) {};
--- a/Makefile
+++ b/Makefile
@@ -43,12 +43,16 @@
 	      | grep -v total; \
 	done
 	@$(CLOSURE_COMPILER) --js src/prettify.js \
+		--externs console-externs.js \
+		--externs amd-externs.js \
 	    --define IN_GLOBAL_SCOPE=true \
 	    --output_wrapper='!function(){%output%}()' \
 	    > $(TAR_ROOT)/prettify.js
 	@wc -c src/prettify.js $(TAR_ROOT)/prettify.js \
 	    | grep -v total
 	@$(CLOSURE_COMPILER) --js src/run_prettify.js \
+		--externs console-externs.js \
+		--externs amd-externs.js \
 	    --define IN_GLOBAL_SCOPE=false \
 	    --output_wrapper='!function(){%output%}()' \
 	    > $(TAR_ROOT)/run_prettify.js