Skip to content

Minor fixes #1

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

Merged
merged 7 commits into from
Jun 2, 2020
Merged

Minor fixes #1

merged 7 commits into from
Jun 2, 2020

Conversation

stheophil
Copy link
Contributor

A few things I stumbled over.

The fixed header order makes it easier to include your headers if compiling with TC_PRIVATE

The Array ctor fixes the issue that

inline constexpr char sz[] = "Test";

tc::js::Arraytc::jst::js_string(tc::jst::create_js_object, tc::single(sz))

would not compile. Your ctor uses tc::range_value_t which asserts that the range value does not decay.

@stheophil
Copy link
Contributor Author

My initial solution for the Array ctor was not such a good idea. Using tc::explicit_cast is correct and Arno-approved. Instead of tc::range_value_t I use tc::range_reference_t now and that works.

@stheophil
Copy link
Contributor Author

Inside namespace tc::js all namespaces must be global qualified namespaces.

If the user declares in typescript

declare namespace std {
    function Test() : void;
}

Then just writing std::forward inside namespace tc::js will fail because in the generated header

namespace tc::js {
    using std = js_defs::_js_jstd;
}

with error message

js_bootstrap.h:138:46: error: no template named 'forward' in 'tc::jst::no_adl::js_reftc::js_defs::_impl_js_jstd'; did you mean 'boost::forward'?

@stheophil stheophil requested a review from yeputons May 26, 2020 12:13
@yeputons
Copy link
Collaborator

yeputons commented Jun 2, 2020

Thanks! I've added same code for ReadonlyArray and added a test; created a separate issue for tracking the global qualification (#2)

@yeputons yeputons merged commit 1bddf40 into master Jun 2, 2020
@yeputons yeputons deleted the minor_fixes branch June 2, 2020 13:50
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