googlearchive / caja

Caja is a tool for safely embedding third party HTML, CSS and JavaScript in your website.
Apache License 2.0
1.13k stars 113 forks source link

Remove overloading of "synthetic" #250

Closed kpreid closed 9 years ago

kpreid commented 9 years ago

Original issue 250 created by ihab.awad on 2008-05-07T17:31:12.000Z:

We use the term "synthetic" in our codebase to mean two things --

Rename classes and fields throughout the codebase to disambiguate. For example, the first case should be renamed "NodeFlags" or "NodeAttributes" or something.

kpreid commented 9 years ago

Comment #1 originally posted by mikesamuel on 2008-05-07T23:17:30.000Z:

The term "synthetic attributes" is widely used in the dragon book. I'll try to get my copy and see if there's another similar term.

The term "synthetic" as a declaration modifier is used in the java bytecode spec. http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jdwp/jdwp-protocol.html boolean canGetSyntheticAttribute Can the VM determine whether a field or method is synthetic? (that is, can the VM determine if the method or the field was invented by the compiler?)

Renaming either term to a less widely used and understood term might be more confusing than the present usage.

kpreid commented 9 years ago

Comment #2 originally posted by ihab.awad on 2008-05-07T23:23:13.000Z:

Aha, interesting. Well, we should definitely skew in favor of those who are familiar with the dragon book. :)

So maybe the issue is that there are synthetic attributes, and there is a distinguished one of those that says "this whole node is synthetic". So maybe the latter is the issue, and should be called NODE_IS_SYNTHETIC or SYNTHETIC_NODE or something. I don't know. And maybe it should not be part of the -.plugin package; I understand that this is mainly historical but maybe it's time to move it.

kpreid commented 9 years ago

Comment #3 originally posted by mikesamuel on 2008-05-28T01:15:33.000Z:

<empty>

kpreid commented 9 years ago

Comment #4 originally posted by mikesamuel on 2008-08-15T17:59:35.000Z:

Synthetic usage has been changed so that only Identifiers and Function Constructors can be marked synthetic and the meaning is now well-defined in DefaultCajaRewriter.