On 18.7.2012 1:05, Ian Hickson wrote:
And if you want it to be defined in JS file itself, I'll suggest "use
strict" approach:
file> ---------------------------------------------------------------
"Access-Control-Allow-Origin: *";
(function(){
"use strict";
var x = 5;
})();
---------------------------------------------------------------<file
Whether it's a string or a comment seems like a detail. If we do do this,
I expect we'll find something that's somewhat language-agnostic (e.g.
allowing any leading and trailing punctuation on the first line, or
something to that effect).
Well not exactly a detail... we already have comment processing in HTML
and JS... (IE). Script minifiers can have issues with that, JS engines
would have to start parse end somehow execute comments to look for
something suspicious in a text without recognizable syntax and semantics
(garbage)
Maybe some specific object, as a property on window / worker scope would
be inline with language and requiremenets (=to define script properties)
(this|self).ScriptProperties = {
DisableCrossOriginExecution = false, //to disable CO script sharing,
since current default is true
AllowCrossOriginWorkerExecution = true //to enable CO in workers,
since current default is false
}
it would also allow any future extensions
BK