Skip to content

Commit

Permalink
Moves shared/function.js to core/
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed May 23, 2014
1 parent 7a19085 commit fcc4dfd
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 23 deletions.
1 change: 0 additions & 1 deletion examples/acroforms/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<!-- In production, only one script (pdf.js) is necessary -->
<!-- In production, change the content of PDFJS.workerSrc below -->
<script src="../../src/shared/util.js"></script>
<script src="../../src/shared/function.js"></script>
<script src="../../src/shared/annotation.js"></script>
<script src="../../src/display/api.js"></script>
<script src="../../src/display/metadata.js"></script>
Expand Down
1 change: 0 additions & 1 deletion examples/helloworld/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<!-- In production, only one script (pdf.js) is necessary -->
<!-- In production, change the content of PDFJS.workerSrc below -->
<script src="../../src/shared/util.js"></script>
<script src="../../src/shared/function.js"></script>
<script src="../../src/shared/annotation.js"></script>
<script src="../../src/display/api.js"></script>
<script src="../../src/display/metadata.js"></script>
Expand Down
1 change: 0 additions & 1 deletion make.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ target.bundle = function(args) {

var SHARED_SRC_FILES = [
'shared/util.js',
'shared/function.js',
'shared/annotation.js',
];

Expand Down
17 changes: 16 additions & 1 deletion src/shared/function.js → src/core/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals PostScriptLexer, PostScriptParser, error, info, isArray, isBool */
/* globals PostScriptLexer, PostScriptParser, error, info, isArray, isBool,
isDict, isStream */

'use strict';

Expand Down Expand Up @@ -436,6 +437,20 @@ var PDFFunction = (function PDFFunctionClosure() {
};
})();

function isPDFFunction(v) {
var fnDict;
if (typeof v != 'object') {
return false;
} else if (isDict(v)) {
fnDict = v;
} else if (isStream(v)) {
fnDict = v.dict;
} else {
return false;
}
return fnDict.has('FunctionType');
}

var PostScriptStack = (function PostScriptStackClosure() {
var MAX_STACK_SIZE = 100;
function PostScriptStack(initialStack) {
Expand Down
14 changes: 0 additions & 14 deletions src/shared/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,20 +963,6 @@ function isRef(v) {
return v instanceof Ref;
}

function isPDFFunction(v) {
var fnDict;
if (typeof v != 'object') {
return false;
} else if (isDict(v)) {
fnDict = v;
} else if (isStream(v)) {
fnDict = v.dict;
} else {
return false;
}
return fnDict.has('FunctionType');
}

/**
* Promise Capability object.
*
Expand Down
2 changes: 1 addition & 1 deletion src/worker_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
// List of shared files to include;
var sharedFiles = [
'shared/util.js',
'shared/function.js',
'shared/annotation.js'
];

Expand All @@ -34,6 +33,7 @@ var otherFiles = [
'core/obj.js',
'core/charsets.js',
'core/cidmaps.js',
'core/function.js',
'core/colorspace.js',
'core/crypto.js',
'core/pattern.js',
Expand Down
2 changes: 1 addition & 1 deletion test/font/font_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<script src="../../src/display/webgl.js"></script>
<script src="../../src/core/obj.js"></script>
<script src="../../src/shared/annotation.js"></script>
<script src="../../src/shared/function.js"></script>
<script src="../../src/core/function.js"></script>
<script src="../../src/core/charsets.js"></script>
<script src="../../src/core/cidmaps.js"></script>
<script src="../../src/core/colorspace.js"></script>
Expand Down
1 change: 0 additions & 1 deletion test/test_slave.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<title>pdf.js test slave</title>
<style type="text/css"></style>
<script src="/src/shared/util.js"></script>
<script src="/src/shared/function.js"></script>
<script src="/src/shared/annotation.js"></script>
<script src="/src/display/api.js"></script>
<script src="/src/display/metadata.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/unit/unit_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script src="../../src/display/webgl.js"></script>
<script src="../../src/core/obj.js"></script>
<script src="../../src/shared/annotation.js"></script>
<script src="../../src/shared/function.js"></script>
<script src="../../src/core/function.js"></script>
<script src="../../src/core/charsets.js"></script>
<script src="../../src/core/cidmaps.js"></script>
<script src="../../src/core/colorspace.js"></script>
Expand Down
1 change: 0 additions & 1 deletion web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

<!--#if !PRODUCTION-->
<script src="../src/shared/util.js"></script>
<script src="../src/shared/function.js"></script>
<script src="../src/shared/annotation.js"></script>
<script src="../src/display/api.js"></script>
<script src="../src/display/metadata.js"></script>
Expand Down

0 comments on commit fcc4dfd

Please sign in to comment.