-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #299 from NativeScript/ambiguous-metadata
Disambiguate native APIs with name collisions
- Loading branch information
Showing
10 changed files
with
96 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule metadata-generator
updated
34 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// TNSDeclarationConflicts.h | ||
// NativeScriptTests | ||
// | ||
// Created by Jason Zhekov on 11/09/15. | ||
// Copyright (c) 2015 Jason Zhekov. All rights reserved. | ||
// | ||
|
||
@protocol TNSInterfaceProtocolConflict <NSObject> | ||
@end | ||
@protocol TNSInterfaceProtocolConflictProtocol <NSObject> | ||
@end | ||
@interface TNSInterfaceProtocolConflict : NSObject <TNSInterfaceProtocolConflict, TNSInterfaceProtocolConflictProtocol> | ||
@end | ||
|
||
struct TNSStructFunctionConflict { | ||
int x; | ||
}; | ||
void TNSStructFunctionConflict(struct TNSStructFunctionConflict); | ||
|
||
struct TNSStructVarConflict { | ||
int x; | ||
}; | ||
extern const int TNSStructVarConflict; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// TNSDeclarationConflicts.m | ||
// NativeScriptTests | ||
// | ||
// Created by Jason Zhekov on 11/09/15. | ||
// Copyright (c) 2015 Jason Zhekov. All rights reserved. | ||
// | ||
|
||
#import "TNSDeclarationConflicts.h" | ||
|
||
@implementation TNSInterfaceProtocolConflict | ||
@end | ||
|
||
void TNSStructFunctionConflict(struct TNSStructFunctionConflict str) { | ||
TNSLog(@(str.x).stringValue); | ||
} | ||
|
||
const int TNSStructVarConflict = 42; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
describe(module.id, function() { | ||
afterEach(function () { | ||
TNSClearOutput(); | ||
}); | ||
|
||
it("Interface-Protocol", function() { | ||
expect(TNSInterfaceProtocolConflict instanceof NSObject).toBe(true); | ||
expect(NSProtocolFromString("TNSInterfaceProtocolConflict")).toBe(TNSInterfaceProtocolConflictProtocol2); | ||
expect(NSProtocolFromString("TNSInterfaceProtocolConflictProtocol")).toBe(TNSInterfaceProtocolConflictProtocol); | ||
}); | ||
|
||
it("Struct-Function", function() { | ||
TNSStructFunctionConflict(new TNSStructFunctionConflictStruct({ x: 3 })); | ||
expect(TNSGetOutput()).toBe("3"); | ||
}); | ||
|
||
it("Struct-Var", function() { | ||
expect(new TNSStructVarConflictStruct({ x: 3 }).x).toBe(3); | ||
expect(TNSStructVarConflict).toBe(42); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters