Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
5f4cc21
Changed NSLog to debug to avoid spamming the console in release builds.
samdeane Apr 30, 2014
cd558e5
Changed NSLog to debug to avoid spamming the console in release builds.
samdeane Apr 30, 2014
f27f92b
Merge branch 'warning-fixes'
samdeane May 23, 2014
cd69cba
XC6 update
samdeane Jun 13, 2014
ea788e1
Merge branch 'master' of github.com:BohemianCoding/CocoaScript
samdeane Jun 13, 2014
d265a7d
Merge commit 'b8e60ecff73c3907dc80b573fb000d63fa50f956' into HEAD
samdeane Jun 13, 2014
70ded2f
Merge commit 'd265a7d'
samdeane Jun 13, 2014
044d191
Merge branch 'master' of github.com:ccgus/CocoaScript
samdeane Jun 23, 2014
f69245f
Merge branch 'debug-callback'
samdeane Jun 23, 2014
aa9d5db
Fixed debug macro.
samdeane Jun 23, 2014
9e912f8
Use a name for the debug method which doesn't clash with the debug ma…
samdeane Jun 23, 2014
679b882
Merge branch 'debug-callback'
samdeane Jun 25, 2014
b159e66
Merge branch 'javascript-debugging-support'
samdeane Jun 25, 2014
936f6f1
Merge branch 'javascript-debugging-support'
samdeane Jun 25, 2014
852774c
Merge branch 'javascript-debugging-support'
samdeane Jun 25, 2014
d186c17
Fixed use of deprecated API
samdeane Aug 15, 2014
f037716
Turned #pragma messages into comments
samdeane Aug 15, 2014
c202ef5
Minor (and slightly ugly) tweak to avoid a warning in release build.
samdeane Sep 1, 2014
78c081d
Turn on SKIP_INSTALL to avoid a warning when archiving
samdeane Sep 1, 2014
ae7c0bb
XC6.1 update
samdeane Nov 18, 2014
aa1dbc0
XC6.1 update - specify the signature for objc_msgSend to prevent a wa…
samdeane Nov 18, 2014
d857274
Import: Add support for absolute and ~ paths
randomsequence Dec 12, 2014
3ba543d
import: reinstate warning for empty base in non-absolute URLs
randomsequence Dec 12, 2014
669c4b0
Merge pull request #2 from BohemianCoding/feature/3319
randomsequence Dec 12, 2014
67e609f
Add support for nested @import statements
randomsequence Dec 16, 2014
33b28c7
Merge pull request #3 from BohemianCoding/feature/3319
randomsequence Dec 16, 2014
fd78d57
Fix a bug which ignored first line of @import-ed scripts
randomsequence Dec 18, 2014
f125568
Merge pull request #4 from BohemianCoding/feature/3319
randomsequence Dec 18, 2014
31b4e73
Added a test script that exhibits the crash
samdeane Feb 11, 2015
fa6871d
Toned down the debug output for the command line tool whilst debuggin…
samdeane Feb 11, 2015
e505ce8
reduced loop as script should crash
samdeane Feb 11, 2015
a812a1b
Slight tweaks to MOBox - tracking down crash
samdeane Feb 11, 2015
3bd263e
Added Andrey's temporary workaround to the crash
samdeane Feb 11, 2015
0aac538
Perform cleanup before exiting - easier to test if it's working...
samdeane Feb 11, 2015
d5ee507
Can't call unprotect from finalize - it wouldn't make much difference…
samdeane Feb 11, 2015
20f99eb
Latest changes from Gus:
samdeane May 27, 2015
0e3c556
Fixed leak of CGColorSpaceRef
samdeane May 27, 2015
821b49d
Keep the analyzer happy with a check for a nil encoding.
samdeane May 27, 2015
e3d2d6d
Fix for a nice leak.
samdeane May 27, 2015
7724039
Disabled the analyzer for a particularly bonkers piece of code.
samdeane May 27, 2015
d48dd44
Another analyzer fix.
samdeane May 27, 2015
f460972
Disabled the analzyer for some particularly gnarly code.
samdeane May 27, 2015
0df6e10
Fixed leak of CGColorSpaceRef
samdeane May 27, 2015
bd27007
Fixed leak of CGColorSpaceRef.
samdeane May 27, 2015
945aab1
Fixed warning.
samdeane May 27, 2015
dd6e529
Changed #pragma to comment to stop it generating a message.
samdeane May 27, 2015
d2b9e4b
Merge branch 'analyzer-fixes' into develop
samdeane May 27, 2015
166c0d4
XC7 updates.
samdeane Jun 10, 2015
ef25dae
Don't use nullable on old versions of Xcode that don't know about it...
samdeane Jun 30, 2015
7f42d6e
and another that XC6.2 doesn't know about
samdeane Jun 30, 2015
b993aea
Slightly cleaner XC6.2 fix.
samdeane Jun 30, 2015
34fd6d9
Replace NSMapTable with NSDictionary & associated objects
randomsequence Aug 20, 2015
7b5a81c
Associate the unboxer with the object, not the box.
randomsequence Aug 20, 2015
bfda639
Remove objects to box map in favour of directly associated objects
randomsequence Aug 20, 2015
28d54ff
Refactor object to box mapping into MOBox
randomsequence Aug 21, 2015
d64d9f8
Merge pull request #6 from BohemianCoding/feature/5799
randomsequence Sep 1, 2015
5b8085d
Revert to 34fd6d9
randomsequence Oct 28, 2015
5fb80ef
Remove MochaUnboxer, which wouldn't have unboxed anything anyway
randomsequence Oct 28, 2015
f817640
Fixed an analyser issue
opsGavin Nov 10, 2015
56bb64a
Added MOBoxManager class to clean up access to boxes a bit.
samdeane Dec 16, 2015
26e5127
Cleaned up boxing a bit, removed the JSProtect hack.
samdeane Dec 16, 2015
b29a1a1
Protect function/selector arguments around calls.
samdeane Dec 16, 2015
58b3f83
Protect all the JS objects representing members of the struct. These …
samdeane Dec 16, 2015
a48761d
Make MOStruct unprotect values when it's shut down.
samdeane Dec 17, 2015
a673e30
Use strong map again instead of dictionary.
samdeane Dec 17, 2015
5246cd5
Simplified slightly.
samdeane Dec 17, 2015
f0e69e8
Commented MOBoxManager
samdeane Dec 17, 2015
12b81e5
Cleaned up and remove some obsolete stuff.
samdeane Dec 17, 2015
9d028f1
Clean out runtime when shutting down COScript, to break retain cycle …
samdeane Dec 17, 2015
ebc6f2a
Strengthened assertion.
samdeane Dec 17, 2015
d7ef038
Brought up to date with Gus' master branch.
samdeane Dec 17, 2015
27b6784
A bit more cleanup.
samdeane Dec 17, 2015
d3273a3
Added some more assertions.
samdeane Dec 17, 2015
5920725
Only add box to the index if the JS initialiser actually gets called.
samdeane Jan 14, 2016
67508c8
More debugging.
samdeane Jan 14, 2016
f5a781f
Don't make a box at all until the JS object has been initialized.
samdeane Jan 14, 2016
093e56c
improved comments and removed some more debug
samdeane Jan 14, 2016
4c565c0
Cleaner implementation of the box creation - pass parameters in a cus…
samdeane Jan 14, 2016
c73b5fa
Fixed out of date comment.
samdeane Jan 14, 2016
d214f18
Disabled some additional debugging.
samdeane Jan 14, 2016
81e15f9
improved comment
samdeane Jan 15, 2016
363a1eb
Disable assertions in release builds.
samdeane Jan 18, 2016
897f31b
Downgraded an assertion to logging instead.
samdeane Jan 19, 2016
64e8b51
Analyzer warning fixes for situations where a parameter might be nil.
samdeane Feb 16, 2016
1272fb3
Supply a name for the context when creating a COScript object.
samdeane Feb 22, 2016
d1f3e12
made JSTTextView part of Cocoascript so that we can use it in Sketch
samdeane Mar 11, 2016
e2abc7c
Removed some deprecated API usage.
samdeane Mar 11, 2016
eac11a0
Pass back the script URL to the error handler if we have it.
samdeane Mar 15, 2016
92be364
Merge commit 'eac11a0' into feature/8204-improve-editing-inside
samdeane Mar 17, 2016
76bb178
Defer re-parsing of text to avoid messing up the selection.
samdeane Mar 18, 2016
9e5a8cd
Fix for endless re-parsing problem.
samdeane Mar 21, 2016
6b5bc1a
Updated for XC8.
samdeane Jun 30, 2016
430f1f3
Turned off the localisation warning that XC8 enabled.
samdeane Jul 1, 2016
b82ee86
Ensure that runtime is thrown away when we cleanup - breaks retain cy…
samdeane Jul 7, 2016
1caf68e
Merge branch 'develop' into feature/9844-memory-leak-in-plugins-
samdeane Jul 8, 2016
6251a1f
Merge branch 'feature/9844-memory-leak-in-plugins-' into people/sam/c…
samdeane Jul 8, 2016
629c08e
Factored out the code that calls JSObjectGetPrivate, and that returns…
samdeane Jul 8, 2016
884b1fa
added a generation counter, and some more debugging
samdeane Jul 8, 2016
e412d2e
Cleaned up some index behaviour.
samdeane Jul 8, 2016
1580a9e
Fixed analyser warning.
samdeane Jul 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 43 additions & 2 deletions Cocoa Script.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
objects = {

/* Begin PBXBuildFile section */
229C1FF61C21B38D004C5B3B /* MOBoxManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 229C1FF41C21B38D004C5B3B /* MOBoxManager.h */; };
229C1FF71C21B38D004C5B3B /* MOBoxManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 229C1FF51C21B38D004C5B3B /* MOBoxManager.m */; };
220D93E71C92E69C001EF05C /* JSTTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = CC66D8CD181A2E2F0039A0A5 /* JSTTextView.m */; };
229C1FF81C21B38D004C5B3B /* MOBoxManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 229C1FF51C21B38D004C5B3B /* MOBoxManager.m */; };
22FBD9951C47EA55004CF31E /* MOBoxManagerBoxContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 22FBD9931C47EA55004CF31E /* MOBoxManagerBoxContext.h */; };
220D93E81C92E75A001EF05C /* JSTTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = CC66D8CC181A2E2F0039A0A5 /* JSTTextView.h */; settings = {ATTRIBUTES = (Public, ); }; };
22FBD9961C47EA55004CF31E /* MOBoxManagerBoxContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FBD9941C47EA55004CF31E /* MOBoxManagerBoxContext.m */; };
22FBD9971C47EA55004CF31E /* MOBoxManagerBoxContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 22FBD9941C47EA55004CF31E /* MOBoxManagerBoxContext.m */; };
384830E21832D48500B34168 /* COSTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 384830E01832D48500B34168 /* COSTarget.h */; };
384830E31832D48500B34168 /* COSTarget.m in Sources */ = {isa = PBXBuildFile; fileRef = 384830E11832D48500B34168 /* COSTarget.m */; };
8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
Expand All @@ -29,7 +37,7 @@
CC4143520F25261200E46669 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCC5B8A40F1EFA6D00126722 /* JavaScriptCore.framework */; };
CC4143530F25261300E46669 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
CC4143620F2527CD00E46669 /* CocoaScript.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC41431A0F25254200E46669 /* CocoaScript.framework */; };
CC4143660F2527E400E46669 /* CocoaScript.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = CC41431A0F25254200E46669 /* CocoaScript.framework */; };
CC4143660F2527E400E46669 /* CocoaScript.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = CC41431A0F25254200E46669 /* CocoaScript.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
CC5EDD4D1237F6DF00E0D965 /* JSTalkStatusIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = CC5EDD4C1237F6DF00E0D965 /* JSTalkStatusIcon.png */; };
CC5EDD531237F71300E0D965 /* JSTalkStatusIconAlt.png in Resources */ = {isa = PBXBuildFile; fileRef = CC5EDD521237F71300E0D965 /* JSTalkStatusIconAlt.png */; };
CC5FB7DF0F1FDE3800F4ECC2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
Expand Down Expand Up @@ -397,6 +405,11 @@
/* Begin PBXFileReference section */
1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
229C1FF41C21B38D004C5B3B /* MOBoxManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MOBoxManager.h; path = src/framework/mocha/Objects/MOBoxManager.h; sourceTree = SOURCE_ROOT; };
229C1FF51C21B38D004C5B3B /* MOBoxManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MOBoxManager.m; path = src/framework/mocha/Objects/MOBoxManager.m; sourceTree = SOURCE_ROOT; };
22E281E41A8BB99D006650D2 /* test.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = test.js; sourceTree = "<group>"; };
22FBD9931C47EA55004CF31E /* MOBoxManagerBoxContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MOBoxManagerBoxContext.h; path = src/framework/mocha/Objects/MOBoxManagerBoxContext.h; sourceTree = SOURCE_ROOT; };
22FBD9941C47EA55004CF31E /* MOBoxManagerBoxContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MOBoxManagerBoxContext.m; path = src/framework/mocha/Objects/MOBoxManagerBoxContext.m; sourceTree = SOURCE_ROOT; };
2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
384830E01832D48500B34168 /* COSTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = COSTarget.h; path = src/framework/COSTarget.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -768,6 +781,7 @@
children = (
CC66D826181A2A810039A0A5 /* CocoaScript_Prefix.pch */,
CC66D8D7181A2FC10039A0A5 /* cocoascript_tool.m */,
22E281E41A8BB99D006650D2 /* test.js */,
);
name = "Other Sources";
sourceTree = "<group>";
Expand Down Expand Up @@ -1130,6 +1144,10 @@
CC66D879181A2B0A0039A0A5 /* MOAllocator.m */,
CC66D87A181A2B0A0039A0A5 /* MOBox.h */,
CC66D87B181A2B0A0039A0A5 /* MOBox.m */,
229C1FF41C21B38D004C5B3B /* MOBoxManager.h */,
229C1FF51C21B38D004C5B3B /* MOBoxManager.m */,
22FBD9931C47EA55004CF31E /* MOBoxManagerBoxContext.h */,
22FBD9941C47EA55004CF31E /* MOBoxManagerBoxContext.m */,
CC66D87C181A2B0A0039A0A5 /* MOClassDescription.h */,
CC66D87D181A2B0A0039A0A5 /* MOClassDescription.m */,
CC66D87E181A2B0A0039A0A5 /* MOClosure_Private.h */,
Expand Down Expand Up @@ -1247,6 +1265,7 @@
CC66D8B2181A2B0A0039A0A5 /* MOPointer_Private.h in Headers */,
CCA1A535183EA86E000159B3 /* COSInterval.h in Headers */,
CC66D8BC181A2B0A0039A0A5 /* MOStruct.h in Headers */,
220D93E81C92E75A001EF05C /* JSTTextView.h in Headers */,
CC66D7D5181A2A470039A0A5 /* TDMultiLineCommentState.h in Headers */,
CC66D7BD181A2A470039A0A5 /* TDAssembly.h in Headers */,
CCE675E8182ED9C900DB1932 /* COSAlertWindow.h in Headers */,
Expand All @@ -1261,6 +1280,7 @@
CC66D869181A2AE10039A0A5 /* MochaRuntime_Private.h in Headers */,
CC66D8B9181A2B0A0039A0A5 /* MOProtocolDescription_Private.h in Headers */,
CC66D824181A2A710039A0A5 /* COSPreprocessor.h in Headers */,
22FBD9951C47EA55004CF31E /* MOBoxManagerBoxContext.h in Headers */,
CC66D836181A2A9B0039A0A5 /* COSCodeSketcher.h in Headers */,
CC66D84E181A2AB10039A0A5 /* MOBridgeSupportSymbol.h in Headers */,
CCD38343195A454F00C436B9 /* COSDatabase.h in Headers */,
Expand All @@ -1272,6 +1292,7 @@
CC66D7CD181A2A470039A0A5 /* TDEmpty.h in Headers */,
CC66D8A3181A2B0A0039A0A5 /* MOClosure.h in Headers */,
CC66D7CF181A2A470039A0A5 /* TDLetter.h in Headers */,
229C1FF61C21B38D004C5B3B /* MOBoxManager.h in Headers */,
CC66D7E6181A2A470039A0A5 /* TDRepetition.h in Headers */,
CC66D834181A2A9B0039A0A5 /* COSCIImageAdditions.h in Headers */,
CC66D83E181A2A9B0039A0A5 /* COSQuickCIFilter.h in Headers */,
Expand Down Expand Up @@ -1392,7 +1413,7 @@
2A37F4A9FDCFA73011CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0500;
LastUpgradeCheck = 0800;
TargetAttributes = {
9FC343C61AF7D2FE00B53759 = {
CreatedOnToolsVersion = 6.3.1;
Expand Down Expand Up @@ -1506,6 +1527,7 @@
CC66D7DF181A2A470039A0A5 /* TDParser.m in Sources */,
384830E31832D48500B34168 /* COSTarget.m in Sources */,
CC66D86B181A2AE10039A0A5 /* MochaRuntime.m in Sources */,
229C1FF81C21B38D004C5B3B /* MOBoxManager.m in Sources */,
CC66D821181A2A710039A0A5 /* COSExtras.m in Sources */,
CC66D83F181A2A9B0039A0A5 /* COSQuickCIFilter.m in Sources */,
CC66D81F181A2A710039A0A5 /* COScript.m in Sources */,
Expand Down Expand Up @@ -1558,6 +1580,7 @@
CC66D813181A2A470039A0A5 /* TDWordOrReservedState.m in Sources */,
CC66D7CA181A2A470039A0A5 /* TDCommentState.m in Sources */,
CC66D7E9181A2A470039A0A5 /* TDReservedWord.m in Sources */,
22FBD9971C47EA55004CF31E /* MOBoxManagerBoxContext.m in Sources */,
CC66D7D0181A2A470039A0A5 /* TDLetter.m in Sources */,
CC66D75B181A2A210039A0A5 /* TETextUtils.m in Sources */,
CC66D84D181A2AB10039A0A5 /* MOBridgeSupportParser.m in Sources */,
Expand All @@ -1566,6 +1589,7 @@
CC66D7E5181A2A470039A0A5 /* TDReader.m in Sources */,
CC66D7D6181A2A470039A0A5 /* TDMultiLineCommentState.m in Sources */,
CC66D8B1181A2B0A0039A0A5 /* MOObjCRuntime.m in Sources */,
220D93E71C92E69C001EF05C /* JSTTextView.m in Sources */,
CC07AF4D1982C310001CCA93 /* COSMarkdown.m in Sources */,
CC66D807181A2A470039A0A5 /* TDTokenizerState.m in Sources */,
CC66D84F181A2AB10039A0A5 /* MOBridgeSupportSymbol.m in Sources */,
Expand Down Expand Up @@ -1647,6 +1671,7 @@
CC9FEFE218296A2A009DB0F9 /* TDEmpty.m in Sources */,
CC9FEFE418296A2A009DB0F9 /* TDLetter.m in Sources */,
CC9FEFE618296A2A009DB0F9 /* TDLiteral.m in Sources */,
22FBD9961C47EA55004CF31E /* MOBoxManagerBoxContext.m in Sources */,
CC9FEFE818296A2A009DB0F9 /* TDLowercaseWord.m in Sources */,
CC9FEFEA18296A2A009DB0F9 /* TDMultiLineCommentState.m in Sources */,
CCD38344195A454F00C436B9 /* COSDatabase.m in Sources */,
Expand All @@ -1672,6 +1697,7 @@
CC9FF01118296A2B009DB0F9 /* TDToken.m in Sources */,
CC9FF01318296A2B009DB0F9 /* TDTokenArraySource.m in Sources */,
CC9FF01518296A2B009DB0F9 /* TDTokenAssembly.m in Sources */,
229C1FF71C21B38D004C5B3B /* MOBoxManager.m in Sources */,
CC9FF01718296A2B009DB0F9 /* TDTokenizer.m in Sources */,
CCD3834A195A454F00C436B9 /* COSDatabaseQueue.m in Sources */,
CC9FF01918296A2B009DB0F9 /* TDTokenizerState.m in Sources */,
Expand Down Expand Up @@ -1812,6 +1838,7 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-DDEBUG";
OTHER_LDFLAGS = "-lffi";
PRODUCT_BUNDLE_IDENTIFIER = com.cocoascript.CocoaScript;
PRODUCT_NAME = "Cocoa Script Editor";
};
name = Debug;
Expand All @@ -1827,6 +1854,7 @@
LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks";
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-lffi";
PRODUCT_BUNDLE_IDENTIFIER = com.cocoascript.CocoaScript;
PRODUCT_NAME = "Cocoa Script Editor";
};
name = Release;
Expand All @@ -1840,9 +1868,13 @@
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -1866,9 +1898,12 @@
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
Expand Down Expand Up @@ -1912,7 +1947,9 @@
AppKit,
"-lexpat",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.cocoascript.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = CocoaScript;
SKIP_INSTALL = YES;
};
name = Debug;
};
Expand All @@ -1924,6 +1961,7 @@
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
ENABLE_NS_ASSERTIONS = NO;
FRAMEWORK_VERSION = A;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = src/framework/CocoaScript_Prefix.pch;
Expand All @@ -1945,7 +1983,9 @@
"-lexpat",
"-lffi",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.cocoascript.${PRODUCT_NAME:identifier}";
PRODUCT_NAME = CocoaScript;
SKIP_INSTALL = YES;
};
name = Release;
};
Expand Down Expand Up @@ -2002,6 +2042,7 @@
9FC343D21AF7D2FE00B53759 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "Cocoa Script Editor" */ = {
isa = XCConfigurationList;
Expand Down
26 changes: 12 additions & 14 deletions res/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,12 @@
<string>JSTPluginMover</string>
</dict>
</array>

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Cocoa Script Whatever</string>
<key>CFBundleURLSchemes</key>
<array>
<string>x-coscript</string>
</array>
</dict>
</array>

<key>CFBundleExecutable</key>
<string>Cocoa Script Editor</string>
<key>CFBundleIconFile</key>
<string>JSTalk.icns</string>
<key>CFBundleIdentifier</key>
<string>com.cocoascript.CocoaScript</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -80,6 +67,17 @@
<string>3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Cocoa Script Whatever</string>
<key>CFBundleURLSchemes</key>
<array>
<string>x-coscript</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
Expand Down
2 changes: 1 addition & 1 deletion res/JSTalkFramework-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.cocoascript.${PRODUCT_NAME:identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down
17 changes: 17 additions & 0 deletions src/cocoascript_tool.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@

BOOL JSCErrorHandlerExitOnError = YES;

@interface NullDebugController : NSObject<CODebugController>

@end

@implementation NullDebugController

- (void)output:(NSString*)format args:(va_list)args
{

}

@end

@interface JSCErrorHandler : NSObject {

}
Expand Down Expand Up @@ -92,11 +105,15 @@ int main(int argc, char *argv[]) {
}
}

[COScript setDebugController:[NullDebugController new]];

id o = [t executeString:source];

if (o) {
printf("%s\n", [[o description] UTF8String]);
}

[t cleanup];

return 0;
}
31 changes: 20 additions & 11 deletions src/editor/JSTTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ @interface JSTTextView ()
@property (assign) CGPoint initialDragPoint;
@property (strong) NSNumber *initialNumber;
@property (strong) NSMutableDictionary *numberRanges;
@property (assign) BOOL parsingInResponseToEdit;

@end

Expand Down Expand Up @@ -168,9 +169,17 @@ - (void)parseCode:(id)sender {
}



- (void) textStorageDidProcessEditing:(NSNotification *)note {
[self parseCode:nil];
- (void)textStorage:(NSTextStorage *)textStorage didProcessEditing:(NSTextStorageEditActions)editedMask range:(NSRange)editedRange changeInLength:(NSInteger)delta {
// SD: calling parseCode directly from here was causing the selection to be messed up when deleting characters - seemingly some sort of timing issue.
// deferring the parse has fixed that, but at the expense of causing potential recursion since the parse then seems to register as another edit.
// to avoid this, I've added the parsingInResponseToEdit flag, but it's all a bit clumsy; a better fix might be to sort out the original deletion problem
if (!self.parsingInResponseToEdit) {
dispatch_async(dispatch_get_main_queue(), ^{
self.parsingInResponseToEdit = YES;
[self parseCode:nil];
self.parsingInResponseToEdit = NO;
});
}
}

- (NSArray *)writablePasteboardTypes {
Expand All @@ -188,22 +197,22 @@ - (void)autoInsertText:(NSString*)text {

}

- (void)insertText:(id)insertString {
- (void)insertText:(id)insertString replacementRange:(NSRange)replacementRange {

if (!([JSTPrefs boolForKey:@"codeCompletionEnabled"])) {
[super insertText:insertString];
[super insertText:insertString replacementRange:replacementRange];
return;
}

// make sure we're not doing anything fance in a quoted string.
if (NSMaxRange([self selectedRange]) < [[self textStorage] length] && [[[self textStorage] attributesAtIndex:[self selectedRange].location effectiveRange:nil] objectForKey:JSTQuotedStringAttributeName]) {
[super insertText:insertString];
if (NSMaxRange(replacementRange) < [[self textStorage] length] && [[[self textStorage] attributesAtIndex:replacementRange.location effectiveRange:nil] objectForKey:JSTQuotedStringAttributeName]) {
[super insertText:insertString replacementRange:replacementRange];
return;
}

if ([@")" isEqualToString:insertString] && [_lastAutoInsert isEqualToString:@")"]) {

NSRange nextRange = [self selectedRange];
NSRange nextRange = replacementRange;
nextRange.length = 1;

if (NSMaxRange(nextRange) <= [[self textStorage] length]) {
Expand All @@ -222,8 +231,8 @@ - (void)insertText:(id)insertString {

[self setLastAutoInsert:nil];

[super insertText:insertString];
[super insertText:insertString replacementRange:replacementRange];

NSRange currentRange = [self selectedRange];
NSRange r = [self selectionRangeForProposedRange:currentRange granularity:NSSelectByParagraph];
BOOL atEndOfLine = (NSMaxRange(r) - 1 == NSMaxRange(currentRange));
Expand Down
6 changes: 6 additions & 0 deletions src/framework/COSExtras.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,16 @@ - (void)system:(NSString*)s {

@implementation NSApplication (COSExtras)

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

- (id)open:(NSString*)pathToFile {

NSError *err = nil;

NSURL *url = [NSURL fileURLWithPath:pathToFile];

// TODO - this call needs replacing as it is deprecated, but the new API is async so it requires a little bit of work
id doc = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:url
display:YES
error:&err];
Expand All @@ -120,6 +124,8 @@ - (id)open:(NSString*)pathToFile {
return doc;
}

#pragma clang diagnostic pop

- (void)activate {
ProcessSerialNumber xpsn = { 0, kCurrentProcess };
SetFrontProcess( &xpsn );
Expand Down
Loading