File tree 3 files changed +11
-11
lines changed
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 5
5
// Created by John Holdsworth on 26/09/2015.
6
6
// Copyright © 2015 John Holdsworth. All rights reserved.
7
7
//
8
- // $Id: //depot/SwiftRuby/Object.swift#16 $
8
+ // $Id: //depot/SwiftRuby/Object.swift#17 $
9
9
//
10
10
// Repo: https://github.com/RubyNative/SwiftRuby
11
11
//
@@ -42,10 +42,10 @@ open class ENVProxy {
42
42
}
43
43
44
44
@_silgen_name ( " instanceVariablesForClass " )
45
- func instanceVariablesForClass( _ cls: AnyClass , _ ivarNames: NSMutableArray ) -> [ String ]
45
+ func instanceVariablesForClass( _ cls: AnyClass , _ ivarNames: NSMutableArray ) -> NSArray
46
46
47
47
@_silgen_name ( " methodSymbolsForClass " )
48
- func methodSymbolsForClass( _ cls: AnyClass ) -> [ String ]
48
+ func methodSymbolsForClass( _ cls: AnyClass , _ syms : NSMutableArray ) -> NSArray
49
49
50
50
open class RubyObject {
51
51
@@ -54,11 +54,11 @@ open class RubyObject {
54
54
}
55
55
56
56
open var instance_variables : [ String ] {
57
- return instanceVariablesForClass ( type ( of: self ) , NSMutableArray ( ) )
57
+ return instanceVariablesForClass ( type ( of: self ) , NSMutableArray ( ) ) . map { $0 as! String }
58
58
}
59
59
60
60
open var methods : [ String ] {
61
- return methodSymbolsForClass ( type ( of: self ) ) . map { _stdlib_demangleName ( String ( $0 ) ) }
61
+ return methodSymbolsForClass ( type ( of: self ) , NSMutableArray ( ) ) . map { _stdlib_demangleName ( $0 as! String ) }
62
62
}
63
63
64
64
}
Original file line number Diff line number Diff line change 5
5
// Created by John Holdsworth on 12/10/2015.
6
6
// Copyright © 2015 John Holdsworth. All rights reserved.
7
7
//
8
- // $Id: //depot/SwiftRuby/Utilities.h#8 $
8
+ // $Id: //depot/SwiftRuby/Utilities.h#9 $
9
9
//
10
10
// Repo: https://github.com/RubyNative/SwiftRuby
11
11
//
16
16
#import < Foundation/Foundation.h>
17
17
18
18
extern NSArray <NSString *> * _Nonnull instanceVariablesForClass ( Class _Nonnull cls, NSMutableArray <NSString *> * _Nonnull ivarNames );
19
- extern NSArray <NSString *> * _Nonnull methodSymbolsForClass ( Class _Nonnull cls );
19
+ extern NSArray <NSString *> * _Nonnull methodSymbolsForClass ( Class _Nonnull cls, NSMutableArray < NSString *> * _Nonnull syms );
20
20
21
21
extern NSString * _Nonnull kCatchLevels ;
22
22
Original file line number Diff line number Diff line change 5
5
// Created by John Holdsworth on 26/09/2015.
6
6
// Copyright © 2015 John Holdsworth. All rights reserved.
7
7
//
8
- // $Id: //depot/SwiftRuby/Utilities.m#18 $
8
+ // $Id: //depot/SwiftRuby/Utilities.m#19 $
9
9
//
10
10
// Repo: https://github.com/RubyNative/SwiftRuby
11
11
//
30
30
31
31
struct _swift_data3 {
32
32
// unsigned long flags;
33
- const char *className;
33
+ // const char *className;
34
+ int className;
34
35
int fieldcount, flags2;
35
36
int ivarNames;
36
37
int get_field_data;
75
76
return ivarNames;
76
77
}
77
78
78
- NSArray <NSString *> *methodSymbolsForClass ( Class cls ) {
79
- NSMutableArray <NSString *> *syms = [NSMutableArray new ];
79
+ NSArray <NSString *> *methodSymbolsForClass ( Class cls, NSMutableArray <NSString *> *syms ) {
80
80
81
81
struct _in_objc_class *swiftClass = (__bridge struct _in_objc_class *)cls;
82
82
You can’t perform that action at this time.
0 commit comments