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

Minor fixups #1148

Merged
merged 2 commits into from
Mar 16, 2015
Merged

Minor fixups #1148

merged 2 commits into from
Mar 16, 2015

Conversation

bnoordhuis
Copy link
Member

e = Exception::Error(cons2);
Local<String> path_string;
if (path != nullptr) {
// FIXME(bnoordhuis) It's questionable to interpret the file path as UTF-8.
Copy link
Contributor

Choose a reason for hiding this comment

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

What alternative is there?

Copy link
Member Author

Choose a reason for hiding this comment

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

One-byte strings or if you want more radical, buffers or typed arrays. It also depends on the platform: file paths are untyped binary blobs on most Unices, but on OS X (i.e. HFS+) and Windows, they're Unicode.

I'm not sure yet what the right answer is, just that our current approach is wrong. :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point about different data formats. I was only thinking about string encoding.

@trevnorris
Copy link
Contributor

One non-blocking question. LGTM

Rewrite ErrnoException() so that it doesn't turn the file path into a
string twice.

PR-URL: nodejs#1148
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
With --max_old_space_size=12345 it's possible to create a JS heap that
is larger than what fits in an unsigned int so use Number::New() rather
than Integer::NewFromUnsigned().

Performance-wise, it doesn't matter much.  If V8 can fit the double in
a SMI, it will.

PR-URL: nodejs#1148
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
@bnoordhuis bnoordhuis closed this Mar 16, 2015
@bnoordhuis bnoordhuis deleted the minor-fixups branch March 16, 2015 17:03
@bnoordhuis bnoordhuis merged commit 2551c1d into nodejs:v1.x Mar 16, 2015
@rvagg rvagg mentioned this pull request Mar 17, 2015
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.

None yet

2 participants