Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDFDoc() now detects argument type #542

Merged
merged 1 commit into from
Sep 27, 2011
Merged

Conversation

arturadib
Copy link
Contributor

As per discussion with @angreasgal in #532, PDFDoc() now detects whether the argument is ArrayBuffer() or our own Stream(), and initializes accordingly.

var stream = new Stream(data);
function constructor(arg, callback) {
// Stream argument
if (typeof arg.isStream !== 'undefined') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be |typeof arg.isStream !== 'undefined' && arg.isStream| ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose someone could really mess with us and add a isStream = false to an object... So, yep :)

Or more simply: if (arg.isStream). I just added typeof for consistency with the test below it (ArrayBuffer type).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cgjones I was just about to fix this :) oh well, I guess it's no biggie.

joneschrisg added a commit that referenced this pull request Sep 27, 2011
PDFDoc() now detects argument type
@joneschrisg joneschrisg merged commit 73e41cb into mozilla:master Sep 27, 2011
@joneschrisg
Copy link
Contributor

Let's merge it with your next pull request.

stephanrauh added a commit to stephanrauh/pdf.js that referenced this pull request Nov 25, 2020
stephanrauh added a commit to stephanrauh/pdf.js that referenced this pull request Nov 26, 2020
stephanrauh added a commit to stephanrauh/pdf.js that referenced this pull request Nov 26, 2020
stephanrauh added a commit to stephanrauh/pdf.js that referenced this pull request Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants