Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(51)

Issue 7509043: Move util functions from DefaultParametersTransformer.js to src/semantics/util.js (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 3 months ago by usrbincc
Modified:
13 years, 2 months ago
Reviewers:
arv, eddyb
CC:
traceur-compiler-reviews_googlegroups.com
Base URL:
https://code.google.com/p/traceur-compiler/@master
Visibility:
Public.

Description

Move util functions from DefaultParametersTransformer.js to src/semantics/util.js BUG=None TEST=None

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -24 lines) Patch
M src/codegeneration/DefaultParametersTransformer.js View 2 chunks +5 lines, -23 lines 0 comments Download
M src/semantics/util.js View 2 chunks +42 lines, -1 line 2 comments Download

Messages

Total messages: 9
usrbincc
I realized (kind of late) that I should probably break out the semantics/util.js re-org from ...
13 years, 3 months ago (2013-03-06 16:05:27 UTC) #1
arv
LGTM Committed as f1c6f630de05bf3d9a1fe4a41323b0d31bd2da06
13 years, 3 months ago (2013-03-06 17:38:53 UTC) #2
arv
On 2013/03/06 16:05:27, usrbincc wrote: > In the future, how should I handle this kind ...
13 years, 3 months ago (2013-03-06 17:40:39 UTC) #3
usrbincc
> I think it is up to you. Of course it is better to split ...
13 years, 3 months ago (2013-03-07 15:07:53 UTC) #4
eddyb
There is a small bug with this patch, VOID is not imported from ParseTreeType, and ...
13 years, 2 months ago (2013-03-26 18:52:35 UTC) #5
arv
https://codereview.appspot.com/7509043/diff/1/src/semantics/util.js File src/semantics/util.js (right): https://codereview.appspot.com/7509043/diff/1/src/semantics/util.js#newcode65 src/semantics/util.js:65: return tree.type === UNARY_EXPRESSION && tree.operator.type === VOID && ...
13 years, 2 months ago (2013-03-26 19:18:38 UTC) #6
usrbincc
> VOID is not imported Thanks for the bug fix. One thing I found interesting ...
13 years, 2 months ago (2013-03-26 19:41:29 UTC) #7
arv
On 2013/03/26 19:41:29, usrbincc wrote: > > VOID is not imported > > Thanks for ...
13 years, 2 months ago (2013-03-26 19:55:30 UTC) #8
usrbincc
13 years, 2 months ago (2013-03-26 21:14:43 UTC) #9
Message was sent while issue was closed.
> At one point I hacked up a version of free variable checker that took
> a list of free variable names instead of (as well as) inspecting the
> global object. Maybe this is worth doing again?

I think it's definitely worth doing. Not that I wasn't before, but this
recent bug fix has left no doubt. It's one less thing to think about,
which leaves more brain cells free for tasks that computers aren't good
at -- writing programs, as opposed to running them.

  Oddly enough, I have no use for IDEs. There are certain things you
  just have to know cold. Humans are actually good at that, if the
  number of things isn't too much. And if they have backup. Because
  everyone messes up every once in awhile.

I guess the only question is how we're going to interface with it --
through magic comments, some kind of syntax, or just programmatically
through some sort of plugin or scripting system?

Typescript uses these things called "typings" or definition files.

 
http://typescript.codeplex.com/SourceControl/changeset/view/ac38ce9e29b3#typi...

They also have something called "ambient declarations".

 
http://www.typescriptlang.org/Content/TypeScript%20Language%20Specification.pdf

    declare var document;
    document.title = "Hello"; // Ok because document has been declared

I think adding syntax is a little too heavyweight, especially since it's
not even part of the spec.

Magic comments? Maybe. Though that's a slippery slope, and you might end
up with closure-compiler all over again. And I don't think Peter would
approve of that.

I think scripting is probably the easiest, and the most powerful. I
know, with great power comes great... yada yada. Just give me the power
already!

  Well, maybe some simple magic comments, as long as we keep it dead
  simple. I don't think it's worth trying to declare what members of an
  object are valid. Though I guess we could just generate these
  complicated magic comments, which wouldn't be that bad.

  At that point, maybe just syntax, in a dedicated file that doesn't
  participate at all in the compilation at all except during the
  checking phase.

  Wait. That's 'typings' all over again.

  But if you're going to do that, you might as well just use JS
  scripting. That way you have a much more expressive language, plus you
  don't even have to write or modify the parser.

I'm thinking in addition to a simple list, the ability to pass in a
function that takes the current scope chain and the current var name
being checked as arguments, and returns true if it's "on the list" and
false if it should get back in line and wait for the normal checking
procedure to go through all the vars.

  butabi = 42; // what do you mean, I'm not on the list!
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b