To mimic Objective-C correctly the +initialize method should not be sent on a class hierarchy if it does not implement it.
Also the +initialize method should not allowed to be forwarded to another target with Invocation or any other forwarding mechanism.
Added test cases for this and cleaned up some test cases that succeeded for the wrong reason.
This change will not affect many projects as all classes inherit from CPObject.
The xml parser in the Node.js engine is more modern and can handle more cases. Our property list parser does not handle this. This fix makes the test cases for the property lists run on the Node.js engine.
This allows us to inline the message send function in DEBUG mode. This is great when stepping into a method in the debugger as the message send function is not a separate function. Also the stack traces in the debugger is much more compact as the message send function is not there.
To add source maps add the ”-S” flag to the Jake file when compiling from command line. In the browser you need to add the compiler option into your index.html file. It should look something like this:
OBJJ_COMPILER_FLAGS = [... , "SourceMap"];
All browsers has support for source maps but currently Chrome works best.
Due to Javascript don’t need to have semicolon at end of statement there are times when the parser thinks the line continues on the next line.
For example we have a file.js:
var f = function(x)
{
return x + x;
}
Now in another file we do:
#include file.js
(function(exports) {
a = 42;
})(exports.b)
There will be two different behaviors if the ’file.js’ has a semicolon at the end of the last line. This commit make sure we have the right behavior.
It is polluting the global namespace.
Seven years ago this line was added and even then the variable wasn't
being used but it was a local variable so would have been hard to spot
unless a linter should catch things like that.
Then some four years ago it was accidently converted to a global
variable because the line above it ended in a semicolon rather than
a comma. 'use strict' didn't exist at the time this file was created
and hasn't been added in general yet.
A long standing bug that never mattered because each class is
initialized with a protocol_list set to an empty array. This
is not the case for the protocol objects but there the syntax
was correct already.
From the first day this class was added to the repo, the sub_classes
property, which is initialized with an empty array, has gone unused.
Removing it. A little less code. A little subsequent processing
and memory used.
The life will be easier to have the same in both environments.
Warnings and errors now don’t use read only properties for line and column information. So the test cases in Toolstest.j now work in modern JS engines.
It is also easier to set options for the compiler.