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

do not export isConsoleInstance #2850

Merged
merged 3 commits into from
Sep 3, 2019
Merged

Conversation

justjavac
Copy link
Contributor

I saw in the typedoc that isConsoleInstance should not be exported, it is only used inside console.ts.

@bartlomieju
Copy link
Member

@justjavac I think this is related to #2649, unfortunately I still can't construct new console (the same error appears). This feature is still wanted especially for test runner

@justjavac
Copy link
Contributor Author

const c = new Deno.Console(Deno.core.print) ?

@bartlomieju
Copy link
Member

I'll get back to you @justjavac I need to update my branch after recent changes to build process

@bartlomieju
Copy link
Member

@justjavac so I updated my branch and I still get this error when trying to create new console:

error TS2741: Property '[isConsoleInstance]' is missing in type 'Deno.Console' but required in type 'consoleTypes.Console'.

► file:https:///Users/biwanczuk/dev/deno_std/testing/mod.ts:63:3

63   window.console = fakeConsole;
     ~~~~~~~~~~~~~~

  '[isConsoleInstance]' is declared here.

    ► $asset$/lib.deno_runtime.d.ts:2036:5

    2036     [isConsoleInstance]: boolean;
             ~~~~~~~~~~~~~~~~~~~

Any idea what's wrong? isConsoleInstace is set to true in the constructor of Console....

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Can you also remove from js/lib.deno_runtime.d.ts

@justjavac
Copy link
Contributor Author

done

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@ry ry merged commit e990845 into denoland:master Sep 3, 2019
@justjavac justjavac deleted the is-console-instance branch September 3, 2019 07:51
@bartlomieju
Copy link
Member

bartlomieju commented Sep 3, 2019

@justjavac can you look at this comment? #2850 (comment)

@justjavac
Copy link
Contributor Author

@bartlomieju I have tried it, it can work

@bartlomieju
Copy link
Member

@justjavac can you show a repro? The above error appears when I create new Console instance in deno_std and run it with strict TS checks

@justjavac
Copy link
Contributor Author

Because of a duplication of type isConsoleInstance. Try to compile deno from the latest master, it can construct the Console instance.

@justjavac
Copy link
Contributor Author

I will retry it tomorrow.

This pull request was closed.
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.

3 participants