Browse Source

Use #provided instead of JSObjectProxy / #basicAt:.

Herby Vojčík 5 years ago
parent
commit
18be22ecdc

+ 4 - 4
external/cli/src/AmberCli.js

@@ -2410,7 +2410,7 @@ return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$3,$4,$2,$5;
 $1=$self["@path"];
-$3=$recv($globals.JSObjectProxy)._on_(require);
+$3=$recv(require)._provided();
 $4=$recv(aString).__comma("/package.json");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
@@ -2435,10 +2435,10 @@ return $recv($self["@path"])._join_with_(modulePath,scriptPath);
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString", "anotherString"],
-source: "npmScriptForModule: aString named: anotherString\x0a\x09| modulePath packageJson binSection scriptPath |\x0a\x09modulePath := path dirname: (\x0a\x09\x09(JSObjectProxy on: require)\x0a\x09\x09\x09resolve: aString, '/package.json').\x0a\x09packageJson := Smalltalk readJSObject: (\x0a\x09\x09require value: aString, '/package.json').\x0a\x09binSection := packageJson at: 'bin'.\x0a\x09scriptPath := binSection isString\x0a\x09\x09ifTrue: [ binSection ]\x0a\x09\x09ifFalse: [ binSection at: anotherString ].\x0a\x09^ path join: modulePath with: scriptPath",
-referencedClasses: ["JSObjectProxy", "Smalltalk"],
+source: "npmScriptForModule: aString named: anotherString\x0a\x09| modulePath packageJson binSection scriptPath |\x0a\x09modulePath := path dirname: (\x0a\x09\x09require provided resolve: aString, '/package.json').\x0a\x09packageJson := Smalltalk readJSObject: (\x0a\x09\x09require value: aString, '/package.json').\x0a\x09binSection := packageJson at: 'bin'.\x0a\x09scriptPath := binSection isString\x0a\x09\x09ifTrue: [ binSection ]\x0a\x09\x09ifFalse: [ binSection at: anotherString ].\x0a\x09^ path join: modulePath with: scriptPath",
+referencedClasses: ["Smalltalk"],
 //>>excludeEnd("ide");
-messageSends: ["dirname:", "resolve:", "on:", ",", "readJSObject:", "value:", "at:", "ifTrue:ifFalse:", "isString", "join:with:"]
+messageSends: ["dirname:", "resolve:", "provided", ",", "readJSObject:", "value:", "at:", "ifTrue:ifFalse:", "isString", "join:with:"]
 }),
 $globals.Initer);
 

+ 1 - 2
external/cli/src/AmberCli.st

@@ -1077,8 +1077,7 @@ initialize
 npmScriptForModule: aString named: anotherString
 	| modulePath packageJson binSection scriptPath |
 	modulePath := path dirname: (
-		(JSObjectProxy on: require)
-			resolve: aString, '/package.json').
+		require provided resolve: aString, '/package.json').
 	packageJson := Smalltalk readJSObject: (
 		require value: aString, '/package.json').
 	binSection := packageJson at: 'bin'.

+ 6 - 6
src/Platform-ImportExport.js

@@ -3469,7 +3469,7 @@ return $self._error_("AMD loader not present");
 } else {
 var require;
 require=$receiver;
-return $recv($recv(require)._basicAt_("toUrl"))._value_(aString);
+return $recv($recv(require)._provided())._toUrl_(aString);
 }
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"toUrl:",{aString:aString},$globals.AmdPackageHandler)});
@@ -3477,10 +3477,10 @@ return $recv($recv(require)._basicAt_("toUrl"))._value_(aString);
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString"],
-source: "toUrl: aString\x0a\x09^ Smalltalk amdRequire\x0a\x09\x09ifNil: [ self error: 'AMD loader not present' ]\x0a\x09\x09ifNotNil: [ :require | (require basicAt: 'toUrl') value: aString ]",
+source: "toUrl: aString\x0a\x09^ Smalltalk amdRequire\x0a\x09\x09ifNil: [ self error: 'AMD loader not present' ]\x0a\x09\x09ifNotNil: [ :require | require provided toUrl: aString ]",
 referencedClasses: ["Smalltalk"],
 //>>excludeEnd("ide");
-messageSends: ["ifNil:ifNotNil:", "amdRequire", "error:", "value:", "basicAt:"]
+messageSends: ["ifNil:ifNotNil:", "amdRequire", "error:", "toUrl:", "provided"]
 }),
 $globals.AmdPackageHandler);
 
@@ -4210,7 +4210,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv($recv(require)._basicAt_("config"))._value_($globals.HashedCollection._newFromPairs_(["paths",$globals.HashedCollection._newFromPairs_([$self._namespace(),aString])]));
+$recv($recv(require)._provided())._config_($globals.HashedCollection._newFromPairs_(["paths",$globals.HashedCollection._newFromPairs_([$self._namespace(),aString])]));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"setPath:",{aString:aString},$globals.AmdPackageTransport)});
@@ -4218,10 +4218,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString"],
-source: "setPath: aString\x0a\x09\x22Set the path the the receiver's `namespace`\x22\x0a\x09\x0a\x09(require basicAt: 'config') value: #{\x0a\x09\x09'paths' -> #{\x0a\x09\x09\x09self namespace -> aString\x0a\x09\x09}\x0a\x09}.",
+source: "setPath: aString\x0a\x09\x22Set the path the the receiver's `namespace`\x22\x0a\x09\x0a\x09require provided config: #{\x0a\x09\x09'paths' -> #{\x0a\x09\x09\x09self namespace -> aString\x0a\x09\x09}\x0a\x09}.",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["value:", "basicAt:", "namespace"]
+messageSends: ["config:", "provided", "namespace"]
 }),
 $globals.AmdPackageTransport);
 

+ 2 - 2
src/Platform-ImportExport.st

@@ -912,7 +912,7 @@ load: aPackage
 toUrl: aString
 	^ Smalltalk amdRequire
 		ifNil: [ self error: 'AMD loader not present' ]
-		ifNotNil: [ :require | (require basicAt: 'toUrl') value: aString ]
+		ifNotNil: [ :require | require provided toUrl: aString ]
 ! !
 
 !AmdPackageHandler class methodsFor: 'commit paths'!
@@ -1076,7 +1076,7 @@ namespace: aString
 setPath: aString
 	"Set the path the the receiver's `namespace`"
 	
-	(require basicAt: 'config') value: #{
+	require provided config: #{
 		'paths' -> #{
 			self namespace -> aString
 		}