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

dart2js: more nuanced identification of valid names #7554

Open
rakudrama opened this issue Dec 21, 2012 · 10 comments
Open

dart2js: more nuanced identification of valid names #7554

rakudrama opened this issue Dec 21, 2012 · 10 comments
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@rakudrama
Copy link
Member

The following are fields on DOM objects (according to WebKit IDL, there may be more in other browsers).

Q a b c d e f r x y z
ch cx cy db dx dy fr fx fy go id k1 k2 k3 k4 r1 r2 rx ry x1 x2 y1 y2

This means they should not be used as (possibly minified) method names. Calling, e.g. obj.a() on a CSSMatrix will attempt to call a number instead of signalling noSuchMethod (either via a TypeError or a handler on Object.prototype.a).

But it is perfectly fine to use these short names as parameter names, local variable names, or names of top level isolate functions.

dart2js should use different validity predicates for:

  1. locals (the only issue is lexical shadowing)
  2. fields (the receiver type is well known in order to generate a property access)
  3. instance methods (receiver may be unknown, can't clash with any browser or JavaScript properties or and fields)
  4. static methods
@peter-ahe-google
Copy link
Contributor

cc @ErikCorryGoogle.

@ErikCorryGoogle
Copy link
Contributor

We should probably include the 3 and 4-letter ones too. Stephen, can you generate the list?


Set owner to @rakudrama.

@rakudrama
Copy link
Member Author

This should do until we generate all the names in a form usable by the compiler.

3:
add
all
alt
arc
CCW
cmp
dir
end
get
in1
in2
INT
key
log
low
m11
m12
m13
m14
m21
m22
m23
m24
m31
m32
m33
m34
m41
m42
m43
m44
max
min
now
ONE
put
red
rel
rev
RGB
sdp
set
src
tag
top
uid
uri
url
URL

4:
abbr
atob
Attr
axes
axis
back
BACK
beta
bias
Blob
blue
blur
BLUR
body
BOOL
BOTH
btoa
BYTE
cite
clip
code
cols
cues
data
DECR
DONE
face
file
File
fill
find
font
form
gain
hash
head
high
hint
host
href
HRTF
IDLE
INCR
info
INIT
isId
item
KEEP
kind
knee
lang
left
LESS
line
link
list
load
loop
mode
name
Node
None
NONE
only
open
OPEN
ping
play
port
rect
Rect
refX
refY
RGBA
root
rows
save
seed
seek
self
send
show
SINE
size
span
stat
step
stop
tags
text
Text
time
type
view
warn
wrap
ZERO


Set owner to @ErikCorryGoogle.

@rakudrama
Copy link
Member Author

An additional validity predicate is required for:

  1. constructor functions, which may not use the dispatch tags of native classes.

See Issue #8460 for more info

@anders-sandholm
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the M4 milestone.

@kasperl
Copy link

kasperl commented Apr 22, 2013

Removed this from the M4 milestone.
Added this to the M5 milestone.

@kasperl
Copy link

kasperl commented May 23, 2013

Added TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

cc @rakudrama.
Removed the owner.
Removed this from the M5 milestone.
Added this to the Later milestone.
Removed TriageForM5 label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Feb 29, 2016
@vsmenon vsmenon added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label Jul 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

7 participants