Skip to content

c$ is global #11

@BobHanson

Description

@BobHanson

There is no need for c$ to be a global. It can be removed from being a global value by the following process:

  1. changing all Clazz.pu$h() calls to Clazz.pu$h(c$)

  2. in j2slib, changing Clazz.pu$h and Clazz.p0p to:

Clazz.pu$h = function (c$) {
		Clazz.cla$$$tack,push(c$)
};
Clazz.p0p = function () {
		return  Clazz.cla$$$tack,pop();
};

  1. in j2slib, wrapping all JavaScript that contains references to c$ with a localizing function:

     	eval ("(function(){var c$;" + transport.responseText + "})()");
    

Alternatively, better, would be for the compiler to make sure c$ is local.

This completes the localization of all J2S variables in SwingJS. The only global variables in SwingJS are Clazz and the various packages such as java, org, and com.

This works as described for SwingJS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions