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