mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-09 10:20:59 +00:00
Merge branch 'master' of git@github.com:280north/cappuccino
This commit is contained in:
commit
9353d0f95c
5 files changed
+23
-26
No files matched your search
@@ -24,6 +24,7 @@
|
||||
@import "CGGeometry.j"
|
||||
|
||||
@import "CPControl.j"
|
||||
@import "CPStringDrawing.j"
|
||||
|
||||
#include "CoreGraphics/CGGeometry.h"
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ exports.objj_eval = function(/*String*/ aString)
|
||||
// We need this while code still refers to window.
|
||||
Executable.setCommonJSArguments(require, exports, module, system, print, window);
|
||||
|
||||
var executable = preprocess(aString, "", 0);
|
||||
var executable = exports.preprocess(aString, "", 0);
|
||||
|
||||
if (!executable.hasLoadedFileDependencies())
|
||||
executable.loadFileDependencies();
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
@import <AppKit/CPButton.j>
|
||||
@import <AppKit/CPStringDrawing.j>
|
||||
|
||||
@implementation CPButtonTest : OJTestCase
|
||||
{
|
||||
}
|
||||
|
||||
- (void)testCanCreate
|
||||
{
|
||||
var button = [CPButton buttonWithTitle:"hello world"];
|
||||
[self assertTrue:!!button];
|
||||
}
|
||||
|
||||
@end
|
||||
+1
-1
@@ -227,7 +227,7 @@ function pressEnvironment(rootPath, outputFiles, environment, options) {
|
||||
for (var path in requiredFiles)
|
||||
{
|
||||
var executable = analyzer.executableForImport(path),
|
||||
bundle = _OBJJ.CFBundle.bundleContainingPath(executable.path()),
|
||||
bundle = analyzer.context.global.CFBundle.bundleContainingPath(executable.path()),
|
||||
relativePath = FILE.relative(FILE.join(bundle.path(), ""), executable.path());
|
||||
|
||||
if (executable.path() !== path)
|
||||
|
||||
@@ -2,7 +2,7 @@ var FILE = require("file");
|
||||
var OBJJ = require("objective-j");
|
||||
var Context = require("interpreter").Context;
|
||||
|
||||
function ObjectiveJRuntimeAnalyzer(rootPath)
|
||||
ObjectiveJRuntimeAnalyzer = function(rootPath)
|
||||
{
|
||||
this.rootPath = rootPath;
|
||||
this.context = new Context();
|
||||
@@ -57,8 +57,8 @@ ObjectiveJRuntimeAnalyzer.prototype.initializeGlobalRecorder = function()
|
||||
}
|
||||
|
||||
var _OBJJ = this.require("objective-j");
|
||||
var _fileExecuterForPath = _OBJJ.fileExecuterForPath;
|
||||
_OBJJ.fileExecuterForPath = function(/*String*/ referencePath) {
|
||||
var _fileExecuterForPath = _OBJJ.Executable.fileExecuterForPath;
|
||||
_OBJJ.Executable.fileExecuterForPath = function(/*String*/ referencePath) {
|
||||
var fileExecutor = _fileExecuterForPath.apply(this, arguments);
|
||||
return function(/*String*/ aPath, /*BOOL*/ isLocal, /*BOOL*/ shouldForce) {
|
||||
recordAndReset();
|
||||
@@ -68,7 +68,7 @@ ObjectiveJRuntimeAnalyzer.prototype.initializeGlobalRecorder = function()
|
||||
// NOTE: we distinguish local and library imports using absolute and relative paths.
|
||||
// we resolve the library paths later (in "mergeLibraryImports()") since doing it here seems
|
||||
// to change the resulting recorded globals.
|
||||
if (isLocal)
|
||||
if (isLocal && !FILE.isAbsolute(aPath))
|
||||
currentFile = FILE.normal(FILE.join(referencePath, aPath));
|
||||
else
|
||||
currentFile = aPath;
|
||||
@@ -88,7 +88,7 @@ ObjectiveJRuntimeAnalyzer.prototype.load = function(path)
|
||||
{
|
||||
this.require("objective-j").objj_eval(
|
||||
"("+(function(path) {
|
||||
fileImporterForPath("/")(path, true, function() {
|
||||
objj_importFile(path, true, function() {
|
||||
print("Done importing and evaluating: " + path);
|
||||
});
|
||||
})+")"
|
||||
@@ -331,25 +331,6 @@ function markFilesReferencedByTokens(tokens, globalsToFiles, referencedFiles) {
|
||||
});
|
||||
}
|
||||
|
||||
@implementation PressBundleDelgate : CPObject
|
||||
{
|
||||
Function didFinishLoadingCallback;
|
||||
}
|
||||
- (id)initWithCallback:(Function)aCallback
|
||||
{
|
||||
if (self = [super init]) {
|
||||
didFinishLoadingCallback = aCallback;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)bundleDidFinishLoading:(CPBundle)aBundle
|
||||
{
|
||||
print("didFinishLoading: "+aBundle);
|
||||
if (didFinishLoadingCallback)
|
||||
didFinishLoadingCallback(aBundle);
|
||||
}
|
||||
@end
|
||||
|
||||
// create a new scope loaded with Narwhal and Objective-J
|
||||
function setupObjectiveJ(context)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user