Prechádzať zdrojové kódy

Merge branch 'master' of github.com:amber-smalltalk/amber

Nicolas Petton 11 rokov pred
rodič
commit
2193eb51b0
2 zmenil súbory, kde vykonal 20 pridanie a 13 odobranie
  1. 2 2
      js/amber.js
  2. 18 11
      test/Test.js

+ 2 - 2
js/amber.js

@@ -146,7 +146,7 @@ amber = (function() {
 	}
 
 	function buildJSURL(name, prefix, urlHome) {
-		prefix = prefix || '';
+		prefix = prefix ? prefix + '/' : '';
 		urlHome = urlHome || home;
 
 		var parts = name.match(/^(.*\/)([^/]*)$/);
@@ -159,7 +159,7 @@ amber = (function() {
 			name = name + nocache;
 		}
 
-		return urlHome + prefix + '/' + name;
+		return urlHome + prefix + name;
 	}
 
 	function loadCSS(name, prefix) {

+ 18 - 11
test/Test.js

@@ -2,13 +2,13 @@ smalltalk.addPackage('Test');
 smalltalk.addClass('NodeTestRunner', smalltalk.Object, [], 'Test');
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 category: 'not yet classified',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._runTestSuite();
+return smalltalk.withContext(function($ctx1) { 
+_st(self)._runTestSuite();
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.NodeTestRunner.klass)})},
 args: [],
 source: "initialize\x0a\x09self runTestSuite",
@@ -18,24 +18,31 @@ referencedClasses: []
 smalltalk.NodeTestRunner.klass);
 
 smalltalk.addMethod(
-"_runTestSuite",
 smalltalk.method({
 selector: "runTestSuite",
 category: 'not yet classified',
 fn: function (){
 var self=this;
 var suite,worker;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
-suite=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
-_st(_st(_st((smalltalk.TestCase || TestCase))._allSubclasses())._select_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(each)._isAbstract())._not();
+function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
+function $TestCase(){return smalltalk.TestCase||(typeof TestCase=="undefined"?nil:TestCase)}
+function $TestSuiteRunner(){return smalltalk.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
+function $ResultAnnouncement(){return smalltalk.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
+suite=_st($OrderedCollection())._new();
+_st(_st(_st($TestCase())._allSubclasses())._select_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(each)._isAbstract())._not();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(suite)._addAll_(_st(each)._buildSuite());
+return smalltalk.withContext(function($ctx2) {
+return _st(suite)._addAll_(_st(each)._buildSuite());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-worker=_st((smalltalk.TestSuiteRunner || TestSuiteRunner))._on_(suite);
-_st(_st(worker)._announcer())._on_do_((smalltalk.ResultAnnouncement || ResultAnnouncement),(function(ann){
+worker=_st($TestSuiteRunner())._on_(suite);
+_st(_st(worker)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
 var result;
-return smalltalk.withContext(function($ctx2) {
result=_st(ann)._result();
+return smalltalk.withContext(function($ctx2) {
+result=_st(ann)._result();
 result;
 $1=_st(_st(result)._runs()).__eq(_st(result)._total());
 if(smalltalk.assert($1)){