|
@@ -2640,118 +2640,6 @@ $core.addClass('NativeFunction', $globals.Object, [], 'Kernel-Methods');
|
|
|
$globals.NativeFunction.comment="I am a wrapper around native functions, such as `WebSocket`.\x0aFor 'normal' functions (whose constructor is the JavaScript `Function` object), use `BlockClosure`.\x0a\x0a## API\x0a\x0aSee the class-side `instance creation` methods for instance creation.\x0a\x0aCreated instances will most probably be instance of `JSObjectProxy`.\x0a\x0a## Usage example:\x0a\x0a\x09| ws |\x0a\x09ws := NativeFunction constructor: 'WebSocket' value: 'ws://localhost'.\x0a\x09ws at: 'onopen' put: [ ws send: 'hey there from Amber' ]";
|
|
|
|
|
|
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "constructor:",
|
|
|
-protocol: 'instance creation',
|
|
|
-fn: function (aString){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-
|
|
|
- self._deprecatedAPI_("Use constructorNamed:");
|
|
|
- var nativeFunc=eval(aString);
|
|
|
- return new nativeFunc();
|
|
|
- ;
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"constructor:",{aString:aString},$globals.NativeFunction.klass)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aString"],
|
|
|
-source: "constructor: aString\x0a\x09<\x0a\x09\x09self._deprecatedAPI_(\x22Use constructorNamed:\x22);\x0a\x09\x09var nativeFunc=eval(aString);\x0a\x09\x09return new nativeFunc();\x0a\x09>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.NativeFunction.klass);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "constructor:value:",
|
|
|
-protocol: 'instance creation',
|
|
|
-fn: function (aString,anObject){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-
|
|
|
- self._deprecatedAPI_("Use constructorNamed:value:");
|
|
|
- var nativeFunc=eval(aString);
|
|
|
- return new nativeFunc(anObject);
|
|
|
- ;
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"constructor:value:",{aString:aString,anObject:anObject},$globals.NativeFunction.klass)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aString", "anObject"],
|
|
|
-source: "constructor: aString value:anObject\x0a\x09<\x0a\x09\x09self._deprecatedAPI_(\x22Use constructorNamed:value:\x22);\x0a\x09\x09var nativeFunc=eval(aString);\x0a\x09\x09return new nativeFunc(anObject);\x0a\x09>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.NativeFunction.klass);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "constructor:value:value:",
|
|
|
-protocol: 'instance creation',
|
|
|
-fn: function (aString,anObject,anObject2){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-
|
|
|
- self._deprecatedAPI_("Use constructorNamed:value:value:");
|
|
|
- var nativeFunc=eval(aString);
|
|
|
- return new nativeFunc(anObject,anObject2);
|
|
|
- ;
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2},$globals.NativeFunction.klass)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aString", "anObject", "anObject2"],
|
|
|
-source: "constructor: aString value:anObject value: anObject2\x0a\x09<\x0a\x09\x09self._deprecatedAPI_(\x22Use constructorNamed:value:value:\x22);\x0a\x09\x09var nativeFunc=eval(aString);\x0a\x09\x09return new nativeFunc(anObject,anObject2);\x0a\x09>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.NativeFunction.klass);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "constructor:value:value:value:",
|
|
|
-protocol: 'instance creation',
|
|
|
-fn: function (aString,anObject,anObject2,anObject3){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-
|
|
|
- self._deprecatedAPI_("Use constructorNamed:value:value:value");
|
|
|
- var nativeFunc=eval(aString);
|
|
|
- return new nativeFunc(anObject,anObject2, anObject3);
|
|
|
- ;
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2,anObject3:anObject3},$globals.NativeFunction.klass)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aString", "anObject", "anObject2", "anObject3"],
|
|
|
-source: "constructor: aString value:anObject value: anObject2 value:anObject3\x0a\x09<\x0a\x09\x09self._deprecatedAPI_(\x22Use constructorNamed:value:value:value\x22);\x0a\x09\x09var nativeFunc=eval(aString);\x0a\x09\x09return new nativeFunc(anObject,anObject2, anObject3);\x0a\x09>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.NativeFunction.klass);
|
|
|
-
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "constructorNamed:",
|