| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2687,9 +2687,11 @@ static void Initialize(Local<Object> target, | |||
| 2687 | 2687 | ||
| 2688 | 2688 | Local<Function> backup_function; | |
| 2689 | 2689 | ||
| 2690 | - if (!Function::New(context, Backup).ToLocal(&backup_function)) { | ||
| 2690 | + if (!Function::New(context, Backup, Local<Value>(), 2) | ||
| 2691 | + .ToLocal(&backup_function)) { | ||
| 2691 | 2692 | return; | |
| 2692 | 2693 | } | |
| 2694 | + backup_function->SetName(env->backup_string()); | ||
| 2693 | 2695 | ||
| 2694 | 2696 | target->Set(context, env->backup_string(), backup_function).Check(); | |
| 2695 | 2697 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -234,3 +234,8 @@ test('backup fails when destination cannot be opened', async (t) => { | |||
| 234 | 234 | message: 'unable to open database file' | |
| 235 | 235 | }); | |
| 236 | 236 | }); | |
| 237 | + | ||
| 238 | + test('backup has correct name and length', (t) => { | ||
| 239 | + t.assert.strictEqual(backup.name, 'backup'); | ||
| 240 | + t.assert.strictEqual(backup.length, 2); | ||
| 241 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments