Skip to content

Commit f87f146

Browse files
committed
Merge branch 'master' into darind/v8-update
2 parents d95a4cd + 8409f9a commit f87f146

File tree

6 files changed

+56
-9
lines changed

6 files changed

+56
-9
lines changed

CHANGELOG.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1+
7.1.1
2+
===
3+
4+
- Reverted: Updated V8 to 8.9 (https://github.com/NativeScript/ns-v8ios-runtime/pull/84)
5+
6+
This release should restore debugging in chrome-devtools.
7+
8+
7.1.0
9+
===
10+
11+
### Features
12+
- Updated V8 to 8.9 (https://github.com/NativeScript/ns-v8ios-runtime/pull/84)
13+
14+
### Bug Fixes
15+
- XCode 12.3 support (https://github.com/NativeScript/ns-v8ios-runtime/pull/92)
16+
- DictionaryAdapter missing handle scopes and locks (https://github.com/NativeScript/ns-v8ios-runtime/pull/90)
17+
- PromiseProxy returns function regardless of underlying property type (https://github.com/NativeScript/ns-v8ios-runtime/pull/90)
18+
119
7.0.6
220
===
321

422
### Bug Fixes
5-
- Do not prematurely release blocks (https://github.com/NativeScript/ns-v8ios-runtime/pull5/83)
23+
- Do not prematurely release blocks (https://github.com/NativeScript/ns-v8ios-runtime/pull/83)
624

725

826
7.0.5
@@ -113,4 +131,4 @@
113131
6.2.0-alpha.1-v8 (2019-09-18)
114132
=====
115133

116-
Initial public release
134+
Initial public release

NativeScript/NativeScript-Prefix.pch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef NativeScript_Prefix_pch
22
#define NativeScript_Prefix_pch
33

4-
#define NATIVESCRIPT_VERSION "7.0.0"
4+
#define NATIVESCRIPT_VERSION "7.1.1"
55

66
#ifdef DEBUG
77
#define SIZEOF_OFF_T 8

NativeScript/runtime/DictionaryAdapter.mm

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ - (instancetype)initWithMap:(std::shared_ptr<Persistent<Value>>)map isolate:(Iso
3434

3535
- (id)nextObject {
3636
Isolate* isolate = self->isolate_;
37+
v8::Locker locker(isolate);
38+
Isolate::Scope isolate_scope(isolate);
39+
HandleScope handle_scope(isolate);
40+
3741
Local<Context> context = self->cache_->GetContext();
3842
Local<v8::Array> array = self->map_->Get(isolate).As<Map>()->AsArray();
3943

@@ -82,15 +86,23 @@ - (instancetype)initWithProperties:(std::shared_ptr<Persistent<Value>>)dictionar
8286
}
8387

8488
- (Local<v8::Array>)getProperties {
89+
v8::Locker locker(self->isolate_);
90+
Isolate::Scope isolate_scope(self->isolate_);
91+
EscapableHandleScope handle_scope(self->isolate_);
92+
8593
Local<Context> context = self->cache_->GetContext();
8694
Local<v8::Array> properties;
8795
Local<Object> dictionary = self->dictionary_->Get(self->isolate_).As<Object>();
8896
tns::Assert(dictionary->GetOwnPropertyNames(context).ToLocal(&properties), self->isolate_);
89-
return properties;
97+
return handle_scope.Escape(properties);
9098
}
9199

92100
- (id)nextObject {
93101
Isolate* isolate = self->isolate_;
102+
v8::Locker locker(isolate);
103+
Isolate::Scope isolate_scope(isolate);
104+
HandleScope handle_scope(isolate);
105+
94106
Local<Context> context = self->cache_->GetContext();
95107
Local<v8::Array> properties = [self getProperties];
96108
if (self->index_ < properties->Length()) {
@@ -107,6 +119,10 @@ - (id)nextObject {
107119

108120
- (NSArray*)allObjects {
109121
Isolate* isolate = self->isolate_;
122+
v8::Locker locker(isolate);
123+
Isolate::Scope isolate_scope(isolate);
124+
HandleScope handle_scope(isolate);
125+
110126
Local<Context> context = self->cache_->GetContext();
111127
NSMutableArray* array = [NSMutableArray array];
112128
Local<v8::Array> properties = [self getProperties];
@@ -146,6 +162,10 @@ - (instancetype)initWithJSObject:(Local<Object>)jsObject isolate:(Isolate*)isola
146162
}
147163

148164
- (NSUInteger)count {
165+
v8::Locker locker(self->isolate_);
166+
Isolate::Scope isolate_scope(self->isolate_);
167+
HandleScope handle_scope(self->isolate_);
168+
149169
Local<Object> obj = self->object_->Get(self->isolate_).As<Object>();
150170

151171
if (obj->IsMap()) {
@@ -163,6 +183,10 @@ - (NSUInteger)count {
163183

164184
- (id)objectForKey:(id)aKey {
165185
Isolate* isolate = self->isolate_;
186+
v8::Locker locker(isolate);
187+
Isolate::Scope isolate_scope(isolate);
188+
HandleScope handle_scope(isolate);
189+
166190
Local<Context> context = self->cache_->GetContext();
167191
Local<Object> obj = self->object_->Get(self->isolate_).As<Object>();
168192

@@ -194,6 +218,10 @@ - (id)objectForKey:(id)aKey {
194218
}
195219

196220
- (NSEnumerator*)keyEnumerator {
221+
v8::Locker locker(self->isolate_);
222+
Isolate::Scope isolate_scope(self->isolate_);
223+
HandleScope handle_scope(self->isolate_);
224+
197225
Local<Value> obj = self->object_->Get(self->isolate_);
198226

199227
if (obj->IsMap()) {

NativeScript/runtime/PromiseProxy.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ void PromiseProxy::Init(v8::Local<v8::Context> context) {
2828
return new Proxy(promise, {
2929
get: function(target, name) {
3030
let orig = target[name];
31-
if (name === "then" || name === "catch") {
31+
if (name === "then" || name === "catch" || name === "finally") {
3232
return orig.bind(target);
3333
}
34-
return function(x) {
34+
return typeof orig === 'function' ? function(x) {
3535
CFRunLoopPerformBlock(runloop, kCFRunLoopDefaultMode, orig.bind(target, x));
3636
CFRunLoopWakeUp(runloop);
3737
return target;
38-
};
38+
} : orig;
3939
}
4040
});
4141
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@nativescript/ios",
33
"description": "NativeScript Runtime for iOS",
4-
"version": "7.0.6",
4+
"version": "7.1.1",
55
"keywords": [
66
"NativeScript",
77
"iOS",

project-template/internal/nativescript-build.xcconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ LDPLUSPLUS = $SRCROOT/internal/nsld.sh
2121
// Xcode 12
2222
EXCLUDED_ARCHS_x86_64 = arm64 arm64e
2323
EXCLUDED_ARCHS[sdk=iphonesimulator*] = i386 armv6 armv7 armv7s armv8 $(EXCLUDED_ARCHS_$(NATIVE_ARCH_64_BIT))
24-
EXCLUDED_ARCHS[sdk=iphoneos*] = i386 armv6 armv7 armv7s armv8 x86_64
24+
EXCLUDED_ARCHS[sdk=iphoneos*] = i386 armv6 armv7 armv7s armv8 x86_64
25+
VALIDATE_WORKSPACE = YES

0 commit comments

Comments
 (0)