]> git.parisson.com Git - pdf.js.git/commitdiff
Lower the common denominator
authorChris Jones <jones.chris.g@gmail.com>
Fri, 6 May 2011 05:42:43 +0000 (00:42 -0500)
committerChris Jones <jones.chris.g@gmail.com>
Fri, 6 May 2011 05:42:43 +0000 (00:42 -0500)
pdf.js
test.html

diff --git a/pdf.js b/pdf.js
index 98b097744bcece0e6da5765750220d2190abee5f..a97856de71a29ab25e837a39aa88cfb4ae4afd5f 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -72,14 +72,14 @@ var Obj = (function() {
                 ];
 
     for (var i = 0; i < types.length; ++i) {
-        let type = i;
-        var typeName = types[type];
-        constructor[typeName] = type;
+        var typeName = types[i];
+        constructor[typeName] = i;
         constructor.prototype["is" + typeName] =
-            (function (value) {
-                return this.type == type &&
+            (function is(value) {
+                return this.type == is.type &&
                        (typeof value == "undefined" || value == this.value);
             });
+        constructor.prototype["is" + typeName].type = i;
     }
 
     constructor.prototype.isNum = function(value) {
@@ -99,7 +99,7 @@ var Obj = (function() {
         } else if (this.isNull()) {
             return null;
         } else if (this.isArray()) {
-            return this.value.map(function (e) e.lowerToJS());
+            return this.value.map(function (e) { return e.lowerToJS(); });
         } else {
             return undefined;
         }
@@ -777,7 +777,8 @@ var Interpreter = (function() {
                     if (!this.typeCheck(op.params, args))
                         this.error("Wrong arguments for command '"+ cmd +"'");
 
-                    op.op.call(this, args.map(function (a) a.lowerToJS()));
+                    op.op.call(this,
+                               args.map(function (a) { return a.lowerToJS() }));
                     args.length = 0;
                 } else if (MAX_ARGS == args.length) {
                     this.error("Too many arguments");
index 95a41c22319ab5f7eba610d863f9fc73e70f4219..1710ab6bfea7337d25c0c7e9afdff71f55663911 100644 (file)
--- a/test.html
+++ b/test.html
@@ -1,7 +1,7 @@
 <html>
 <head>
   <title>Simple pdf.js page viewer</title>
-  <script type="application/javascript;version=1.8"
+  <script type="text/javascript"
           src="pdf.js"></script>
   <style type"text/css">
 body {
@@ -20,7 +20,7 @@ body {
 }
   </style>
 
-  <script type="application/javascript;version=1.8">
+  <script type="text/javascript">
 var canvas, numPages, pageDisplay, pageNum;
 function load() {
     canvas = document.getElementById("canvas");